php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5219 PG_Fetch_Array won't work with associative reference
Submitted: 2000-06-25 05:26 UTC Modified: 2000-06-25 05:50 UTC
From: rmsilva_br at yahoo dot com Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 4.0 Release Candidate 2 OS: Linux
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: rmsilva_br at yahoo dot com
New email:
PHP Version: OS:

 

 [2000-06-25 05:26 UTC] rmsilva_br at yahoo dot com
The scenario is described here:

mydb=> create table test (   name char(50), phone char(8) );
mydb=> insert int test values ('Renato', '3434343');

query.php:

<?
$conn = pg_connect("dbname=mydb");
$result = pg_exec($conn, "select name, phone from test")
$arr = pg_fetch_array($result, 0);
echo $arr["name"];
?>

( nothing gets printed out. but if I use $arr[0] I get 'Renato')

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-25 05:50 UTC] jah at cvs dot php dot net
First, please upgrade to at least 4.0.0 and file a new bug report if the
problem exists still. It shouldn't and I'm unable to reproduce this bug.

Besides, your example should produce
'Renato                                            ' (44 spaces, because the field type
is char).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC