php.net |  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
Votes:3
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: robert_xp at gmx dot net
New email:
PHP Version: OS:

 

 [2010-01-04 12:02 UTC] robert_xp at gmx dot net
Description:
------------
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. http://www.xarg.org/2009/12/php-hacking/

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

Expected result:
----------------
1
0

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

Actual result:
--------------
-

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-04 12:46 UTC] uw@php.net
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] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-03-10 22:42 UTC] jani@php.net
Not everything needs a function in PHP.
 [2010-03-10 22:42 UTC] jani@php.net
-Package: *General Issues +Package: MySQL related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 01:01:28 2024 UTC