您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在'*)附近使用正确的语法,在第1行查看FROM statistics WHERE pageVisited ='/ Index.php'
当我尝试运行此查询时:
$con = connect();
$query = "SELECT COUNT (*), FROM statistics WHERE pageVisited = '/Index.php'";
$result = mysql_query($query, $con) or die(mysql_error());
$views = mysql_result($result, 0, "COUNT (*) ");
echo "'the Index page has been viewed'.$views<br />n";
我知道我已经在某处翘起但我不知道在哪里,提前谢谢
答案 0 :(得分:3)
执行此..它可能适合你
$query = "SELECT COUNT(*) FROM statistics WHERE pageVisited = '/Index.php'";
答案 1 :(得分:0)
COUNT和(*)之间不应有空格。 COUNT (*)
,FROM关键字之前也不应该有逗号。