#46161 [NEW]: pg_fetch_result not going to next row
| From: | analogue at glop dot org | Date: | Tue, 23 Sep 2008 13:13:36 +0000 |
| Subject: | #46161 [NEW]: pg_fetch_result not going to next row | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-1166@lists.php.net to get a copy of this message | ||
From: analogue at glop dot org
Operating system: Debian GNU/Linux
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: pg_fetch_result not going to next row
Description:
------------
As stated in the documentation from http://php.net/pg_fetch_result when
used with 2 parameters, pg_fetch_result should go to the next row when
called back.
Parameter row: "Row number in result to fetch. Rows are numbered from 0
upwards. If omitted, next row is fetched."
But when I try to call it multiple times, I always get the same first
row.
Is it a bug or am I misunderstanding the documentation ?
Thanks for looking into it.
Reproduce code:
---------------
$conn = pg_connect($conn_string);
$query = 'SELECT name FROM pg_settings';
$result = pg_query($conn, $query);
echo pg_fetch_result($result, 0)."\n";
echo pg_fetch_result($result, 0)."\n";
echo pg_fetch_result($result, 0)."\n";
pg_close($conn);
Expected result:
----------------
add_missing_from
allow_system_table_mods
archive_command
Actual result:
--------------
add_missing_from
add_missing_from
add_missing_from
--
Edit bug report at http://bugs.php.net/?id=46161&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46161&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46161&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46161&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46161&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=46161&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46161&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46161&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46161&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46161&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46161&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46161&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46161&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46161&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46161&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46161&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46161&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46161&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46161&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46161&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46161&r=mysqlcfg