note 81095 deleted from function.PDOStatement-rowCount by nlopess
| From: | nlopess@php.net | Date: | Thu, 14 Feb 2008 20:18:05 +0000 |
| Subject: | note 81095 deleted from function.PDOStatement-rowCount by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136161@lists.php.net to get a copy of this message | ||
Note Submitter: ethan dot nelson at ltd dot org
----
Another way to count and maintain the iterator is to use a cloned variable.
$counttest = clone $pdostatment;
$num = sizeof($counttest->fetchAll());
$row1 = $dbs->fetch();
Note cloning a large result set is grossly inefficient. SQL can handle a count statement alot
faster, but if you are trying to migrate alot of code which makes extensive use of mssql_num_rows()
quickly, this will do the trick.