Re: Probably there is better solution
| From: | kill-9 | Date: | Thu, 11 Jan 2001 19:25:59 +0000 |
| Subject: | Re: Probably there is better solution | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4926@lists.php.net to get a copy of this message | ||
$result = mysql_query("SELECT any_name_of_column FROM table_name", $db);
if (mysql_num_rows($result)==0)
{
echo "the table is empty ";
}
check the manual under mysql functions there are a lot of very useful
functions there.
kill-9
www.kill-9.dk
for all your mysql and php needs
----- Original Message -----
From: "afan" <afan@sprout.net>
To: <php-windows@lists.php.net>
Sent: Thursday, January 11, 2001 9:24 PM
Subject: [PHP-WIN] Probably there is better solution
Hi all,
I have to know how many entries I have in table/database. Usually, I use
$result = mysql_query("SELECT any_name_of_column FROM table_name", $db);
while($myrow = mysql_fetch_array($result));
{
$Counter++;
}
echo"No of entries: $Checker<br>\n";
Probably there is better and faster solution.
Thanks for any help!
Afan