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_array Next Page



object sqlanywhere_fetch_field( resource result_identifier [, field_offset ] )


Returns an object that contains information about a specific column.


result_identifier    The result identifier returned by a sqlanywhere_query function.

field_offset    An integer representing the column/field on which you want to retrieve information. Columns are zero based; to get the first column, specify the value 0. If this parameter is omitted, then the next field object is returned.


An object that has the following properties:


This example shows how to use sqlanywhere_fetch_field to retrieve all the column information for a result set.

$result = sqlanywhere_query($conn, "SELECT GivenName, Surname FROM Employees");
while( ($field = sqlanywhere_fetch_field( $result )) ) {
        echo " Field ID = $field->ID \n";
        echo " Field name = $field->name \n";
Related functions