Checking if MySQL table is empty
Hey,
I want to make sure that if my MySQL table is empty users would receive "There is no information to display." in their browsers. Here's how I've already tried to do it:
if (!mysql_query("SELECT * FROM Table",$con))
{
echo "<b>There is no information to display.</b><br /><br />";
}
else
{
echo "<b>We have something to show you.</b><br /><br />";
}
Although MySQL table is empty it returns "We have something to show you." as if there are records in that DB table.
What do I do wrong? Is there another way to check if the MySQL table is empty?
* BTW - I'm using UniServer.
Cheers,
DissidentPJ