#50650 [Opn]: mysql_matched_rows
| From: | uw@php.net | Date: | Mon, 04 Jan 2010 12:46:39 +0000 |
| Subject: | #50650 [Opn]: mysql_matched_rows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146312@lists.php.net to get a copy of this message | ||
ID: 50650
Updated by: uw@php.net
Reported By: robert_xp at gmx dot net
Status: Open
Bug Type: Feature/Change Request
PHP Version: 5.3.1
New Comment:
What's the point in coding something that can easily be done in the
user space and expanding an outdated API?
Previous Comments:
------------------------------------------------------------------------
[2010-01-04 12:02:58] 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:
--------------
-
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50650&edit=1