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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC