Num rows for postgres
| From: | Paul Meagher | Date: | Tue, 23 Jan 2001 18:44:39 +0000 |
| Subject: | Num rows for postgres | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1136@lists.php.net to get a copy of this message | ||
I am using postgres and I am trying to get the number of results returned
by a select query.
I would have hoped that something like this would work:
$sql = "SELECT * FROM my_table";
$sth = $dbh->query($sql);
$num_rows = $sth->numRows();
echo $num_rows;
No go however. Does anyone know how to get the number of rows in a result
set using the PEAR database abstraction library?
Regards,
Paul