Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » SQL Anywhere PHP API » SQL Anywhere PHP API reference

sqlanywhere_fetch_field Next Page

sqlanywhere_fetch_object


Prototype

array sqlanywhere_fetch_object( resource result_identifier )

Description

Fetches one row from the result set. This row is returned as an array that can be indexed by the column name only.

Parameters

result_identifier    The result identifier returned by a sqlanywhere_query function.

Returns

An array that represents a row from the result set, or false when no rows are available.

Example

This example shows how to retrieve one row at a time from a result set as an object. Column names can be used as object members to access the column value.

$result = sqlanywhere_query( $conn, "SELECT GivenName, Surname FROM Employees" );
  While( ($row = sqlanywhere_fetch_object( $result )) ) {
        echo "$row->GivenName \n";   # output the data in the first column only.
  }
Related functions