php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27597 pg_fetch_array not returning false
Submitted: 2004-03-14 14:45 UTC Modified: 2004-03-15 14:42 UTC
From: ritchie at ipowerhouse dot com Assigned: helly (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 5CVS-2004-03-15 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ritchie at ipowerhouse dot com
New email:
PHP Version: OS:

 

 [2004-03-14 14:45 UTC] ritchie at ipowerhouse dot com
Description:
------------
looping a recordset based on pg_fetch_array() returning 
false results in an infinite loop 

Reproduce code:
---------------
function xi_fetch_array($rs,$type=PGSQL_ASSOC) {
	$a = pg_fetch_array($rs,NULL,$type) ;
	return $a ;	
}

I use this in previous version with no problem.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-14 18:23 UTC] ritchie at ipowerhouse dot com
Apache 2.0.48/ PG 7.4.1 
 
Hi there, I have a large framework which uses the code, so 
I don't have a small test case. However, I just compiled 
php4.3.4 and everything works fine. My only change was to 
load module 4.3.4 instead of php5 beta 4 in httpd.conf. So 
it is definitly a php5 issue.
 [2004-03-15 09:53 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

And what exactly DOES it return?
(do a var_dump() on the $a variable)

 [2004-03-15 11:16 UTC] ritchie at ipowerhouse dot com
Ok, it's the same on the latest snapshot,   
What I'm getting is the _first record_ of the record set   
returned ad infinitum. This var_dump on $a, was taken   
after dropping out of the loop after 10 interations. But I   
recieved none of the other records only the first.   
   
array(4) { ["name"]=> string(14)   
"affiliate_name" ["value"]=> string(11)   
"ipowerhouse" ["affiliate_id"]=> string(2)   
"-1" ["category"]=> string(3) "iph" }
 [2004-03-15 13:51 UTC] sniper@php.net
The patch r1.296 seems to have broken this.
(see ext/pgsql/pgsql.c:1450-1465, the 1458-1465 is never used)


 [2004-03-15 14:42 UTC] helly@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC