note 59540 added to function.pg-result-seek
| From: | duke at spacebox dot net | Date: | Fri, 09 Dec 2005 10:20:22 +0000 |
| Subject: | note 59540 added to function.pg-result-seek | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99807@lists.php.net to get a copy of this message | ||
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] )
----
Manual Page -- http://www.php.net/manual/en/function.pg-result-seek.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59540
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59540&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59540&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59540&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59540&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59540&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59540&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59540&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59540&report=yes
Search -- http://master.php.net/manage/user-notes.php