|
db2_fetch_rowSets the result set pointer to the next row or requested row Description
bool db2_fetch_row
( resource
$stmt
[, int $row_number
] )Use db2_fetch_row to iterate through a result set, or to point to a specific row in a result set if you requested a scrollable cursor. To retrieve individual fields from the result set, call the db2_result function. Rather than calling db2_fetch_row and db2_result, most applications will call one of db2_fetch_assoc, db2_fetch_both, or db2_fetch_array to advance the result set pointer and return a complete row as an array. Parameters
Return Values
Returns Examples
Example #1 Iterating through a result set The following example demonstrates how to iterate through a result set with db2_fetch_row and retrieve columns from the result set with db2_result.
<?php The above example will output: cat Pook gold fish Bubbles budgerigar Gizmo goat Rickety Ride Example #2 i5/OS recommended alternatives to db2_fetch_row/db2_result On i5/OS it is recommended that you use db2_fetch_both, db2_fetch_array, or db2_fetch_object over db2_fetch_row/db2_result. In general db2_fetch_row/db2_result have more issues with various column types in EBCIDIC to ASCII translation, including possible truncation in DBCS applications. You may also find the performance of db2_fetch_both, db2_fetch_array, and db2_fetch_object to be superior to db2_fetch_row/db2_result.
<?php The above example will output: db2_fetch_both MATCH_ANIMAL 2006-08-25-17.10.23.775000 2006-08-25-17.10.23.775000 db2_fetch_both MULTIRESULTS 2006-10-17-10.11.05.308000 2006-10-17-10.11.05.308000 db2_fetch_array MATCH_ANIMAL 2006-08-25-17.10.23.775000 db2_fetch_array MULTIRESULTS 2006-10-17-10.11.05.308000 db2_fetch_object MATCH_ANIMAL 2006-08-25-17.10.23.775000 db2_fetch_object MULTIRESULTS 2006-10-17-10.11.05.308000 See Also
|