php.net |  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
Votes:2
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 - 10 = ?
Subscribe to this entry?

 
 [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 
celio@ic.unicamp.br
Dec 9, 2002

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-09 11:40 UTC] tal@php.net
Reclassifying.

Tal
 [2003-04-27 16:32 UTC] lsmith@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC