Counting Total DB Rows Used
| From: | Roger Spears | Date: | Wed, 28 Apr 2004 20:41:40 +0000 |
| Subject: | Counting Total DB Rows Used | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12194@lists.php.net to get a copy of this message | ||
Hello,
I'm wondering if there is a PEAR function or command to use for counting to total number of rows used in a database.
Currently I'm using this code, but I'm afraid it's not on par with the best practices available:
$result = $db->query("SELECT * FROM myTable");
if (DB::isError($result))
{
die ($result->getDebugInfo());} while ($result->fetchInto($row)) {
$rowCounter ++;} print "<p>Total Submissions: ".$rowCounter."<br>"; Thanks, Roger