| Joe Stump 2004-04-28, 5:38 pm |
| SELECT COUNT(*) AS total FROM table
--Joe
> -----Original Message-----
> From: Roger Spears [mailto:roger@bgnet.bgsu.edu]
> Sent: Wednesday, April 28, 2004 4:42 PM
> To: PEAR Mailing List
> Subject: [PEAR] Counting Total DB Rows Used
>
>
> 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
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
|