|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26399 function pg_fetch_array() is malfunctioning
Submitted: 2003-11-25 06:16 UTC Modified: 2003-11-25 16:33 UTC
From: elektrik at gmx dot net Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: Irrelevant OS: Linux (SuSe 8.0)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: elektrik at gmx dot net
New email:
PHP Version: OS:


 [2003-11-25 06:16 UTC] elektrik at gmx dot net
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) )


Expected result:
["id"] => 1
["name"] => "bla"

Actual result:
[0] => 1
["id"] => 1
[1] => "bla"
["name"] => "bla"

... infinite loop...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-25 16:33 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Read the manual:
array pg_fetch_array ( resource result [, int row [, int result_type]])
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 18:01:36 2024 UTC