From: akorthaus at web dot de
Operating system: all
PHP version: 5.0.5
PHP Bug Type: PDO related
Bug description: using PDO::query() more than once
Description:
------------
If I want to use PDO::query() more than one time in a script, I have to
set the last PDOStatement to NULL, before I can use the second query. Only
If I add:
$stmt1 = NULL;
before
$stmt2 = $db->query ...
in the example below, I can work with the second query.
But - how can I work with two statments at the same time? I often have to
do this! I don't understand it because I use two different variables for
the statements here.
I have used the pdo_mysql driver (MySQL 4.1.14), pdo and pdo_mysql were
compiled from latest CVS.
Reproduce code:
---------------
<?php
$db = new PDO('...');
$stmt1 = $db->query('SELECT * FROM table1');
var_dump($stmt1);
$stmt2 = $db->query('SELECT * FROM table2');
var_dump($stmt1);
?>
Expected result:
----------------
object(PDOStatement)#2 ...
object(PDOStatement)#2 ...
Actual result:
--------------
object(PDOStatement)#2 ...
bool(false)
--
Edit bug report at http://bugs.php.net/?id=34964&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34964&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=34964&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=34964&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34964&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34964&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34964&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34964&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34964&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34964&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34964&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=34964&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=34964&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34964&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34964&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34964&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34964&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34964&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34964&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34964&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34964&r=mysqlcfg