|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50650 mysql_matched_rows
Submitted: 2010-01-04 12:02 UTC Modified: 2010-03-10 22:42 UTC
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: robert_xp at gmx dot net Assigned:
Status: Wont fix Package: MySQL related
PHP Version: 5.3.1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: robert_xp at gmx dot net
New email:
PHP Version: OS:


 [2010-01-04 12:02 UTC] robert_xp at gmx dot net
Sometimes, it is necessary to get the number of matches instead of the number of affected rows. Matches means for example in an UPDATE, where no changes were made (0) there could be some matches. There are two possebilities for that case: an own mysqli_info() parser or a new single count query.

Reproduce code:
$res = mysqli_query($h, 'UPDATE something ...');
echo mysql_matched_rows($h);
echo mysql_affected_rows($h);

Expected result:

// if there is one row, that has the same value as we want to update

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-04 12:46 UTC]
What's the point in coding something that can easily be done in the user space and expanding an outdated API?
 [2010-03-10 22:42 UTC]
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-03-10 22:42 UTC]
Not everything needs a function in PHP.
 [2010-03-10 22:42 UTC]
-Package: *General Issues +Package: MySQL related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Feb 24 12:01:27 2024 UTC