#20912 [Opn]: tableInfo() method apparently closes result set
| From: | tal@php.net | Date: | Mon, 09 Dec 2002 17:40:57 +0000 |
| Subject: | #20912 [Opn]: tableInfo() method apparently closes result set | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11463@lists.php.net to get a copy of this message | ||
ID: 20912
Updated by: tal@php.net
Reported By: celio@ic.unicamp.br
Status: Open
-Bug Type: *Database Functions
+Bug Type: PEAR related
Operating System: Linux RedHat 7.3
PHP Version: 4.2.3
New Comment:
Reclassifying.
Tal
Previous Comments:
------------------------------------------------------------------------
[2002-12-09 11:39:03] celio@ic.unicamp.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