I'm trying to display the count of a database table on my website. The code I'm using is:
<?php
$results = mysql_query("SELECT COUNT('id') from `idols`");
$count = mysql_result($results, 0);
$idols = number_format($count);
echo "$idols";
?>
But when I test the code it gives me this warning:
Warning: mysql_result() expects parameter 1 to be resource, boolean given on line 92.
Can anyone help me with it?