Fetches a single row of a result set into an array.
Syntax
resource ads_fetch_into( resource result_id
[, int row_number],
array result_array )
Parameters
result_id (I) |
ID of a result set. |
row_number (I) |
Optional row number of the result set to fetch. |
result_array (I/O) |
Reference to the array in which to fetch values. |
Remarks
ads_fetch_into returns the number of fields in the result or returns False in the event of an error. 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_into with a value of 1. This moves the current position to the top of the result set. Subsequent calls to ads_fetch_into 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";
ads_fetch_into( $rResult, $aArray );
echo "Closing the connection<br>\n";
ads_close( $rConn );
echo "Disconnected<br>\n";
?>
See Also