|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-08-02 19:03 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
I've found what I believe is a bug in the php postgresql module. Consider this code: 1 $db = pg_connect("dbname=phpserve user=apache"); 2 3 $sql = "insert into orders(userid, datestamp, completed) 4 values ('0', 'now()', 'f')"; 5 $res = pg_exec($sql) or die("invalid query"); 6 7 print_r($res); 8 print "<br />"; 9 print count($res); 10 $foo = pg_fetch_row($res, 0); 11 print_r($foo); the insert runs fine. the output is "Resource id #2" (which is good), then a 1 (for the count, which is also good) and then an error for the pg_fetch_row() call (error is "PHP Warning: Unable to jump to row 0 on PostgreSQL result index 2 in /var/www/html/phpserve/test.php on line 11") which is where the problem lies. the result from an insert should be the objectid of the record. I'm willing to entertain the possibility that I've done something wrong with my code, and that this isn't a bug in php.