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

SQL Anywhere 11.0.1 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere PHP API » SQL Anywhere PHP API reference



array sasql_fetch_array( sasql_result $result [, int $result_type ])

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


$result   The result resource returned by the sasql_query function.

$result_type   This optional parameter is a constant indicating what type of array should be produced from the current row data. The possible values for this parameter are the constants SASQL_ASSOC, SASQL_NUM, or SASQL_BOTH. It defaults to SASQL_BOTH.

By using the SASQL_ASSOC constant this function will behave identically to the sasql_fetch_assoc function, while SASQL_NUM will behave identically to the sasql_fetch_row function. The final option SASQL_BOTH will create a single array with the attributes of both.


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

Related functions