|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-23 17:43 UTC] lists at cyberlot dot net
[2005-02-26 19:36 UTC] wez@php.net
[2005-02-27 01:47 UTC] lists at cyberlot dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 02:00:02 2025 UTC |
Description: ------------ rowCount() returns 0 when it should return a value While I realize rowCount use on a select is not portable, there has always been the ability to use num_rows within mysql php api's. Docs suggest this should work with mysql Same code using normal mysql api works Reproduce code: --------------- $dsn = 'mysql:dbname=mysql;host=localhost'; $db1 = new PDO($dsn, 'root', ''); $dsn = 'mysql:dbname=venue;host=localhost'; $db2 = new PDO($dsn, 'root', ''); $result2 = $db2->query('SELECT * FROM songs'); echo $result2->rowCount()."\n"; $result1 = $db1->query('SELECT * FROM user'); echo $result1->rowCount()."\n"; Expected result: ---------------- 3 5 Actual result: -------------- 0 0