php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43342 Add PDO constant MYSQL_ATTR_CLIENT_FOUND_ROWS in order to influence rowCount()
Submitted: 2007-11-20 10:42 UTC Modified: 2011-01-01 23:54 UTC
Votes:4
Avg. Score:3.8 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (25.0%)
From: glideraerobatics at hotmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.5 OS: all
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: glideraerobatics at hotmail dot com
New email:
PHP Version: OS:

 

 [2007-11-20 10:42 UTC] 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().


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-07 11:17 UTC] 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.
 [2011-01-01 23:54 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2011-01-01 23:54 UTC] jani@php.net
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 27 11:00:03 2025 UTC