Using the code as demonstrated in this example select count(*) from table of mysql in php
From the most popular "Answer":
$result=mysql_query