ID: 38861
Updated by: [EMAIL PROTECTED]
Reported By: Drezil at web dot de
-Status: Open
+Status: Assigned
Bug Type: PDO related
Operating System: Debian/Sarge
PHP Version: 5.1.6
-Assigned To:
+Assigned To: wez
Previous Comments:
------------------------------------------------------------------------
[2006-09-17 17:11:54] Drezil at web dot de
Description:
------------
with update to php 5.1.6 i ran into problems with the pdo-mysql module
(loaded as dyn. extension in the php.ini).
If i reuse a variable after retrieving a mysql-result any following
result is empty although the query (as shown in the mysql-log) is
ommited correctly and has valid results.
switching mysql 4.1.15 to mysql 5.0.x or the oter way round doesn't fix
anything.
Reproduce code:
---------------
<?php
$user = 'xxx';
$pass = 'xxx';
try {
$dbh = new PDO('mysql:host=localhost;dbname=xxx', $user, $pass);
$qry = $dbh->query('SELECT 1+1')
echo '\''.print($qry->fetch(PDO::FETCH_NUM),true).'\'<br />';
$qry->closeCursor();
$qry = $dbh->query('SELECT 1+1')
echo '\''.print($qry->fetch(PDO::FETCH_NUM),true).'\'<br />';
$qry->closeCursor();
$qry = $dbh->query('SELECT 1+1')
echo '\''.print($qry->fetch(PDO::FETCH_NUM),true).'\'<br />';
$qry->closeCursor();
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
Expected result:
----------------
'2'<br />
'2'<br />
'2'<br />
Actual result:
--------------
'2'<br />
''<br />
''<br />
if i just rename the objects to $qry1, $qry2, $qry3 everything works
fine and as expected.
looks like closeCursor() deosn't work right or the objects are not
overwritten correctly.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38861&edit=1