note 59540 rejected from function.pg-result-seek by didou
| From: | didou@php.net | Date: | Sat, 03 Feb 2007 15:14:05 +0000 |
| Subject: | note 59540 rejected from function.pg-result-seek by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122670@lists.php.net to get a copy of this message | ||
Note Submitter: duke at spacebox dot net
----
Unfortunately you're limited to a loop with a counter - all the pg_fetch functions increment
the row counter *before* fetching a row, so something like
while ($row = pg_fetch_assoc($result)) {...}
is no longer possible after seeking or after fetching one or more results. IMHO, the while loop is
much better to look at than a for loop.
It'd be nice if there were a function to reset the current row to -1. Perhaps the offset
argument to the seek function could be optional; if left out the offset is set to -1.
bool pg_result_seek ( resource result[, int offset] )