FBIRD_FETCH_ASSOC
Purpose
Use the fbird_fetch_assoc function to fetch a row
of a result set into an associative array.
Syntax
<fetch_assoc>
::= fbird_fetch_assoc( res_hndl, [ flags ] )
Element
|
Type
|
Description
|
res_hndl
|
resource
|
A valid result set handle
|
flags
|
int
|
Fetch flags
|
<return>
|
mixed
|
An array on success, False if no rows left
|
Semantics
The fbird_fetch_assoc() function fetches one row
of data from the result set. If two or more columns of the result
have the same field names, the last column will take precedence. To
access the other column(s) of the same name, you either need to
access the result with numeric indices by using ibase_fetch_row() or
use alias names in your query.
Note that Firebird automatically upcases unquoted
identifiers. A select of the form “SELECT email FROM table”
must be accessed as row[“EMAIL”], not as row[“email'].
This function returns an associative array that
corresponds to the fetched row. Subsequent calls will return the next
row in the result set, or False if there are no more rows.
Example
The below example code fragment executes a query
and fetches each row, echoing to the browser:
$sql = 'SELECT * FROM tblname'; $res =
fbird_query($conn, $sql); while ($row = fbird_fetch_assoc($sres))
{ echo
$row["EMAIL"]."\n"; } fbird_free_result($res);
See also
fbird_fetch_object,
fbird_fetch_row,
fbird_query,
fbird_execute
|