ID: 42620 Updated by: [EMAIL PROTECTED] Reported By: mail at chrismandery dot de -Status: Open +Status: Bogus Bug Type: PDO related Operating System: Gentoo AMD64 & Ubuntu 7.04 PHP Version: 5.2.4 New Comment:
Your older bug report describes the same issue as http://bugs.php.net/bug.php?id=42620 . I have explained over there that this is not a PDO_MYSQL bug. Its a PDO bug. Lets close this one and continue the discussion at the newer report. Previous Comments: ------------------------------------------------------------------------ [2007-09-16 02:17:57] JimmyPaterson at gmx dot de I got the same problem on 32 bit Fedora 7 with MySQL 5.0.37 and 5.2.2. The statement is being executed properly, the return value however is always false for subsequent calls. ------------------------------------------------------------------------ [2007-09-10 21:37:01] mail at chrismandery dot de Description: ------------ I am experiencing trouble with PHP using PDO with the MySQL driver. If using the same PDO statement multiple times, all calls but the first to execute() return FALSE, yet fetchAll() still returns the correct results (which may be cached from the first successful call). errorInfo() does not show any usable information. The problem happens with both PHP 5.2.4 on 64 Bit Gentoo as with PHP 5.2.1 on 32 Bit Ubuntu (7.04 aka Feisty Fawn). It is not reproducible on SLES10 or RHEL5 though (which both have no 5.2x PHP, I think). It's not a problem with PHP or PDO because it does not occur when using another database driver (i.e. SQLite). It is also not a problem with MySQL because execution the command multiple times per hand works fine. Some investigations using a network sniffer have shown that all three requests are properly sent to the server and correctly answered, so it should be a problem in the part that parses the answer from the MySQL server. Reproduce code: --------------- $db = new PDO( "mysql:host=localhost;dbname=pem", "pem", "pem" ); $q = $db->prepare( "SELECT * FROM test;" ); for ( $i = 1; $i <= 3; ++$i ) { if ( $q->execute() ) echo "success in $i\n"; else { echo "error in $i:\n"; print_r( $q->errorInfo() ); echo "\n"; } print_r( $q->fetchAll() ); echo "\n\n\n"; $q->closeCursor(); } Expected result: ---------------- success in 1 Array ( [0] => Array ( [abc] => just a [0] => just a [def] => test! [1] => test! ) ) error in 2: Array ( [0] => 00000 ) Array ( [0] => Array ( [abc] => just a [0] => just a [def] => test! [1] => test! ) ) error in 3: Array ( [0] => 00000 ) Array ( [0] => Array ( [abc] => just a [0] => just a [def] => test! [1] => test! ) ) Actual result: -------------- 3 times success instead of 1x success + 2x error. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42620&edit=1
