I count MySQL rows using this function:
function sqlcount($table)
{
$sql = mysql_query("SELECT COUNT(0) FROM $table;");
$sql = mysql_fetch_array($sql);
return $sql[0];
}
Print the result:
echo sqlcount("members");
But this does not work and does not show the true count. What is the problem?
try with this also :
or instead of
COUNT(*)set any field name of the selected Database.