#42883 [Opn->Fbk]: Bad function of rowCount combined with ATTR_EMULATE_PREPARES

From: Date: Mon, 08 Oct 2007 18:51:11 +0000
Subject: #42883 [Opn->Fbk]: Bad function of rowCount combined with ATTR_EMULATE_PREPARES
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-118303@lists.php.net to get a copy of this message
ID: 42883 Updated by: iliaa@php.net Reported By: salac dot r at gmail dot com -Status: Open +Status: Feedback Bug Type: PDO related Operating System: openSUSE 10.2 PHP Version: 5.2.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi Seems to work fine for me. What version of MySQL are you using? Previous Comments: ------------------------------------------------------------------------ [2007-10-07 13:34:46] salac dot r at gmail dot com Description: ------------ When I'm using ATTR_EMULATE_PREPARES set to true, function rowCount returns bad result (0). I think that it's quite strange because without ATTR_EMULATE_PREPARES it returns god values. Reproduce code: --------------- $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass, array( PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::ATTR_EMULATE_PREPARES => true) ); $result=$dbh->query("SELECT * FROM Table"); echo "rows = ".$result->rowCount(); Expected result: ---------------- rows = 7 //number of rows in Table Actual result: -------------- rows = 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42883&edit=1

« previous php.bugs (#118303) next »