Re: return the amount of records in a mysql databace
| From: | Philip J. Newman | Date: | Sun, 22 Sep 2002 18:14:59 +0000 |
| Subject: | Re: return the amount of records in a mysql databace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117189@lists.php.net to get a copy of this message | ||
<?php
$sql = "SELECT count(*) FROM stompers WHERE 1";
$sql_result = mysql_query($sql, $connection) or die ("Could not get Query");
$row = mysql_fetch_array($sql_result);
$sUsers=$row["count(*)"];
echo "<br>We have <b>$sUsers</b> registered users.";
?>
This would be the best way (suggestions would be cool);
----- Original Message -----
From: "Mark Charette" <charette@woodwind.org>
To: "Philip J. Newman" <newmanpj@philipnz.com>; <php-general@lists.php.net>
Sent: Monday, September 23, 2002 1:28 AM
Subject: RE: [PHP] return the amount of records in a mysql databace
> select count(*) as n from ... where ...
>
> -----Original Message-----
> From: Philip J. Newman [mailto:newmanpj@philipnz.com]
>
> Can someone point me in the right direction to find out how i can return
the
> amount of records in a mysql databace ?
>