note 81419 deleted from pdostatement.rowcount by tularis
| From: | tularis@php.net | Date: | Sat, 06 Sep 2008 08:12:22 +0000 |
| Subject: | note 81419 deleted from pdostatement.rowcount by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-144182@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
For SELECT what you want is:
<?php
$rows = $statement->fetchAll();
$count = count($rows);
?>
This will work with every database and has almost no overhead if you wanted to fetch all rows
anyway.
$statement->rowCount() can only count rows in buferred queries, which means it does exactly what
the code above, but you don't see it :)