Fetches a single row of a result set into an array.
Syntax
array ads_fetch_array( resource result_id
[, int row_number] )
Parameters
result_id (I) |
ID of a result set. |
row_number (I) |
Optional row number of the result set to fetch. |
Remarks
ads_fetch_array returns a single row of the result set in an array. Data from binary fields is not read into the array; instead the field is left empty. The maximum amount of data read from memo fields is controlled by the length value specified in a call to ads_longreadlen.
If the optional row_number is not specified, the next row in the result set will be returned.
To read the values from a result set again, call ads_fetch_array with a value of 1. This moves the current position to the top of the result set. Subsequent calls to ads_fetch_array without a row_number will fetch the next row in the result set.
Example
<?
echo "Connecting to Server<br>\n";
$rConn = ads_connect( "DataDirectory=\\\\server1\\share1\\data\\;ServerTypes=2", "", "" );
echo "Connected<br>\n";
echo "Retrieve the customers.<br>\n";
$rResult = ads_do( $rConn, "SELECT * FROM customers" );
echo "Retrieve the sixth row into the array.<br>\n";
$aArray = ads_fetch_array( $rResult, 6 );
echo "Closing the connection<br>\n";
ads_close( $rConn );
echo "Disconnected<br>\n";
?>
See Also