#26399 [NEW]: function pg_fetch_array() is malfunctioning
| From: | elektrik at gmx dot net | Date: | Tue, 25 Nov 2003 11:16:52 +0000 |
| Subject: | #26399 [NEW]: function pg_fetch_array() is malfunctioning | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-50980@lists.php.net to get a copy of this message | ||
From: elektrik at gmx dot net
Operating system: Linux (SuSe 8.0)
PHP version: Irrelevant
PHP Bug Type: PostgreSQL related
Bug description: function pg_fetch_array() is malfunctioning
Description:
------------
The function pg_fetch_array accepts the writing:
pg_fetch_array($result, PGSQL_ASSOC). Standard is PGSQL_BOTH.
With PGSQL_ASSOC I get weard behavior.
Instead of having only associative results, I get an infinite loop of both
assoc. and numeric indexes...
Reproduce code:
---------------
$query = "SELECT * FROM table";
$result = pg_query($link, $query);
while( $row = pg_fetch_array($result, PGSQL_ASSOC) )
print_r($row);
pg_free_result($result);
Expected result:
----------------
["id"] => 1
["name"] => "bla"
Actual result:
--------------
[0] => 1
["id"] => 1
[1] => "bla"
["name"] => "bla"
... infinite loop...
--
Edit bug report at http://bugs.php.net/?id=26399&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26399&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26399&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26399&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26399&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26399&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26399&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26399&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26399&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26399&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26399&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26399&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26399&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26399&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26399&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26399&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26399&r=float