#45080 [Opn->Bgs]: PDOStatement - Mysql Driver - rowCount

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               45080
 Updated by:       [email protected]
 Reported By:      paul dot cocei at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: CentOS 5.1
 PHP Version:      5.2.6
 New Comment:

This is expected behavior, the manual also says that the rowCount will
return affected rows.


Previous Comments:
------------------------------------------------------------------------

[2008-05-23 13:10:24] paul dot cocei at gmail dot com

Description:
------------
Because libmysql contains a method named mysql_stmt_num_rows, it is
possible in the mysql PDO driver to return correctly the total count of
rows selected by a SELECT statement.
Right now, the source code for mysql PDOStatement uses
mysql_stmt_affected_rows, which evidentely returns "0" for SELECT
queries.

Localization: php-5.2.6/ext/pdo_mysql.c, line 202.

Reproduce code:
---------------
row_count = mysql_stmt_affected_rows(S->stmt);



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45080&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.