#20912 [Opn->Csd]: tableInfo() method apparently closes result set

From: Date: Sun, 27 Apr 2003 21:32:10 +0000
Subject: #20912 [Opn->Csd]: tableInfo() method apparently closes result set
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15623@lists.php.net to get a copy of this message
ID: 20912 Updated by: lsmith@php.net Reported By: celio at ic dot unicamp dot br -Status: Open +Status: Closed Bug Type: PEAR related Operating System: Linux RedHat 7.3 PHP Version: 4.2.3 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2002-12-09 11:40:56] tal@php.net Reclassifying. Tal ------------------------------------------------------------------------ [2002-12-09 11:39:03] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20912&edit=1

« previous php.pear.dev (#15623) next »