Edit report at http://bugs.php.net/bug.php?id=43342&edit=1
ID: 43342 Updated by: [email protected] Reported by: glideraerobatics at hotmail dot com Summary: Add PDO constant MYSQL_ATTR_CLIENT_FOUND_ROWS in order to influence rowCount() -Status: Open +Status: Bogus Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: all PHP Version: 5.2.5 Block user comment: N Private report: N New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2008-04-07 11:17:08] chx1975 at gmail dot com http://bugs.php.net/bug.php?id=44135 is the same bug -- but this needs more than a constant because the CLIENT_FOUND_ROWS can only be passed in as a connection flag. ------------------------------------------------------------------------ [2007-11-20 10:42:55] glideraerobatics at hotmail dot com Description: ------------ PDO is very similar in design to Perl's DBI which does allow you to set driver specific attributes such as mysql_client_found_rows=1 as part of the DSN. Setting the attribute mysql_client_found_rows=1 is Perl's DBD::mysql will make the rows() method (equivalent of PDO's rowCount()) return the number of rows matched for the update and not just those that were actually updated. This is a very useful/efficient feature as it prevents the need for doing 'SELECT COUNT(*)' queries before doing the updates and it prevents the need for locking too (since 2 statements are no longer atomic). PDO has a setAttribute() method, but there is as yet no MYSQL_ATTR_CLIENT_FOUND_ROWS constant. My request is that this be built into the PDO mysql driver. The information rowCount() will need can be retrieved from mysql_info(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=43342&edit=1
