|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20912 tableInfo() method apparently closes result set
Submitted: 2002-12-09 11:39 UTC Modified: 2003-04-27 16:32 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: celio at ic dot unicamp dot br Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.2.3 OS: Linux RedHat 7.3
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: celio at ic dot unicamp dot br
New email:
PHP Version: OS:


 [2002-12-09 11:39 UTC] celio at ic dot unicamp dot br
My test  skeleton of PEAR DB commands :
$conn =DB::connect("pgsql://... etc
$stmt= $conn->query($_POST[query]);
$cols= $stmt->tableInfo();
       for ($i=0; $i< $ncols; $i++){
       $col_name[$i]= $cols[$i][name];
       $type[$i]= $cols[$i][type];
       $len[$i]= $cols[$i][len];
       $flags[$i]= $cols[$i][flags];

while( ($r= $stmt->fetchRow())){
       . . . etc
THE PROBLEM: fetchRow() returns Null. If you interchange the order of fetchRow() with tableInfo() no problem arises.
This is unacceptable if you want to format a query result
using information obtained from tableInfo(): you would have
to re-submit the same (possibly large) query again!

MY PHP config.nice file:
'./configure' \
'--with-apxs=/usr/local/apache/bin/apxs' \
'--with-mysql=/usr' \
'--with-pgsql=/usr/local/pgsql' \
'--with-interbase=/opt/interbase' \
'--with-db3' \

Celio Guimaraes
Dec 9, 2002


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-09 11:40 UTC]

 [2003-04-27 16:32 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

I dont have pgsql around to test this. But I think Martins commits to version 1.9 and 1.10 of the pgsql.php file addressed this issue.

Therefore thigns should be fixed in the current beta release  	DB-1.4b1.

Please reopen if problem persists.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 20 16:03:42 2021 UTC