Doc #39072 [Com]: mysqli_affected_rows has self-conflicting documentation

From: Date: Fri, 18 Nov 2016 21:30:00 +0000
Subject: Doc #39072 [Com]: mysqli_affected_rows has self-conflicting documentation
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14124@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=39072&edit=1 ID: 39072 Comment by: aik dot bold at gmail dot com Reported by: php_bug at incognitox dot org Summary: mysqli_affected_rows has self-conflicting documentation Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: N/A PHP Version: Irrelevant Block user comment: N Private report: N New Comment: For me on PHP 5.4+ (PHP 5.5 and PHP 5.6 including) the "mysqli_affected_rows()" always returns "-1" for "SELECT" queries and only "mysqli_num_rows()" gives correct number. When I've used "mysql_affected_rows" (no "i") it was working fine with "SELECT" statements as well. The docs on http://php.net/manual/en/mysqli.affected-rows.php page still looks confusing: --- Returns the number of rows affected by the last INSERT, UPDATE, REPLACE or DELETE query. For SELECT statements mysqli_affected_rows() works like mysqli_num_rows(). --- Previous Comments: ------------------------------------------------------------------------ [2007-01-22 02:48:49] didou@php.net 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. ------------------------------------------------------------------------ [2006-10-07 00:20:37] php_bug at incognitox dot org Description: ------------ The current documentation in the PHP5 manual for the function mysqli_affected_rows (currently visible online at http://php.net/mysqli_affected_rows) has the following conflicting information: "For SELECT statements mysqli_affected_rows() works like mysqli_num_rows()." "The mysqli_affected_rows() function only works with queries which modify a table. In order to return the number of rows from a SELECT query, use the mysqli_num_rows() function instead." The former appears to actually be the case. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=39072&edit=1

« previous php.doc.bugs (#14124) next »