#41325 [Opn->Csd]: mysqli_affected_rows() returns wrong value if warnings are raised
| From: | ljbuesch@php.net | Date: | Sun, 27 May 2007 23:55:54 +0000 |
| Subject: | #41325 [Opn->Csd]: mysqli_affected_rows() returns wrong value if warnings are raised | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969376472@lists.php.net to get a copy of this message | ||
ID: 41325
Updated by: ljbuesch@php.net
Reported By: php-qa at sebastianmendel dot de
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows / Linux
PHP Version: 5.2.2
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Restored old comment that was removed in 1.21.
Previous Comments:
------------------------------------------------------------------------
[2007-05-20 13:56:27] philip@php.net
If the mysqli version of this indeed differs from its mysql brethren,
then the mysqli documentation should be updated. Whether we mention this
difference somewhere, not sure where, but at some point we'll want a
"How to upgrade mysql to mysqli" document.
The user notes should never be used or thought of as a replacement for
documentation. Any doc worthy information from them should be folded
into the manual.
------------------------------------------------------------------------
[2007-05-20 10:22:37] ljbuesch at purdue dot edu
From 1.20 to 1.21 the note:
--
For SELECT statements mysqli_affected_rows works like mysqli_num_rows.
--
Was removed with a commit note by didou:
--
Removed useless note
--
Should we re-add the note, or update the documents to reflect that this
function does indeed work on select statements, as it is misleading to
not mention it.
------------------------------------------------------------------------
[2007-05-08 18:27:21] php-qa at sebastianmendel dot de
just to clarify: my test works as expected and not as i have written,
SORRY!
------------------------------------------------------------------------
[2007-05-08 17:17:46] php-qa at sebastianmendel dot de
ok, my fault, it is not a really a bug in mysqli_affected_rows() - it
is more a documentation bug
the mysql c api function mysql_affected_rows returns not only for teh
last INSERT, UPDATE, REPLACE or DELETE, but for SELECT too
"returns the number of rows changed (for) UPDATE), deleted (for DELETE,
or inserted (for INSERT. For SELECT statements, mysql_affected_rows()
works like mysql_num_rows()."
http://dev.mysql.com/doc/refman/5.1/en/mysql-affected-rows.html
and mysqli_affected_rows() does it the same way, of course, but the php
manual does read other
"Returns the number of rows affected by the last INSERT, UPDATE,
REPLACE or DELETE query."
http://php.net/mysqli_affected_rows
------------------------------------------------------------------------
[2007-05-08 15:28:06] tony2001@php.net
Cannot reproduce on Linux with both client & server of version 5.0.26.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/41325
--
Edit this bug report at http://bugs.php.net/?id=41325&edit=1