Following on from a previous thread, can anyone tell me what’s wrong with the code below:
[CODE]
$count_page = mysql_query(“SELECT page, COUNT (*) FROM user_record GROUP BY page”) or die (“SQL failed: ” . mysql_error());
$num_rowsCount = mysql_num_rows( $count_page );
for($i = 0; $i < $num_rowsCount; $i++)
{
$row = mysql_fetch_array($count_page);
$page = $row[‘page’];
print “<p><b>Page:</b> $page – <b>Hits:</b> $hits</p><br />”;
}
‘page’ is a field that is counted, and user_record is the table. I get the following error: “SQL failed: You have an error in your SQL syntax near ‘(*) FROM user_record GROUP BY page’ at line 1”
Can anyone tell me what’s wrong with the syntax in the code here?
Thanks loads!! ?