Re: Count
| From: | David Robley | Date: | Thu, 30 Aug 2001 00:36:37 +0000 |
| Subject: | Re: Count | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65133@lists.php.net to get a copy of this message | ||
On Thu, 30 Aug 2001 08:16, Kevin P wrote:
> Hi
> I have counted some rows in MySQL and I need to know how to pull out
> the number of rows.
> "SELECT COUNT(*) AS myCount FROM Products"
>
> Thanks
> Kevin
$query = "SELECT COUNT(*) AS myCount FROM Products";
$result = mysql_db_query($database, $query);
$row = mysql_fetch_array($result);
extract($row);
echo $myCount;
might do the trick; unless I've left a syntax error in there :-)
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
I'm so broke, I can't even pay attention.