note 73472 deleted from function.PDOStatement-rowCount by nlopess
| From: | nlopess@php.net | Date: | Sun, 25 Feb 2007 14:45:48 +0000 |
| Subject: | note 73472 deleted from function.PDOStatement-rowCount by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123852@lists.php.net to get a copy of this message | ||
Note Submitter: mandatory_homicide at NOSPAM dot hotmail dot fr
----
You can also use something like that for getting count a select query:
fuction getQueryCount()
{
$stmt = $dbh->prepare($query);
$stmt->execute();
$lines=$stmt->fetchall();
$count=count($lines);
$lines=null;
$stmt=null;
return $count;
}
I work but you may be careful with large amount of rows returned.