September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool odbc_fetch_into(resource result, int row, array array)
Fetches row data from a query.
Returns:
TRUE on success; FALSE on error
Description:
Fetches a row of data into the array passed to the function by reference. Column numbering starts at 0, so it’s important to keep track of field order. It can be a bad idea to use SELECT * FROM table in a query when using this function, as the order of columns returned cannot always be guaranteed.
Version:
Existing since version 3.0.6
Example:
$db = odbc_connect("DSN","user","pass");
$sql = "SELECT ProductName, UnitPrice FROM Products";
$result = odbc_exec($db, $sql);
while (odbc_fetch_into($result, &$row)) {
echo "$row[0] $row[1]\n";
}
|
Read now
Unlock full access