|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-09-19 16:49 UTC] iliaa@php.net
[2006-09-19 18:49 UTC] Drezil at web dot de
[2006-12-03 23:32 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 01:00:01 2025 UTC |
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.