#20912 [NEW]: tableInfo() method apparently closes result set
| From: | celio at ic dot unicamp dot br | Date: | Mon, 09 Dec 2002 17:39:03 +0000 |
| Subject: | #20912 [NEW]: tableInfo() method apparently closes result set | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-27204@lists.php.net to get a copy of this message | ||
From: celio@ic.unicamp.br
Operating system: Linux RedHat 7.3
PHP version: 4.2.3
PHP Bug Type: *Database Functions
Bug description: tableInfo() method apparently closes result set
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 bug report at http://bugs.php.net/?id=20912&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20912&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20912&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20912&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20912&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20912&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20912&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20912&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20912&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20912&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20912&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20912&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20912&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20912&r=isapi