#26399 [Opn->Bgs]: function pg_fetch_array() is malfunctioning
| From: | iliaa@php.net | Date: | Tue, 25 Nov 2003 21:33:02 +0000 |
| Subject: | #26399 [Opn->Bgs]: function pg_fetch_array() is malfunctioning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51065@lists.php.net to get a copy of this message | ||
ID: 26399
Updated by: iliaa@php.net
Reported By: elektrik at gmx dot net
-Status: Open
+Status: Bogus
Bug Type: PostgreSQL related
Operating System: Linux (SuSe 8.0)
PHP Version: Irrelevant
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Read the manual:
array pg_fetch_array ( resource result [, int row [, int result_type]])
Previous Comments:
------------------------------------------------------------------------
[2003-11-25 06:16:52] elektrik at gmx dot net
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 this bug report at http://bugs.php.net/?id=26399&edit=1