我知道這是一個非常常見的問題,但對於上帝的愛我無法在我的php代碼中找到錯誤。那我得到的錯誤是:php/mySQL - 解析錯誤:語法錯誤,意外的T_VARIABLE錯誤
Parse error: syntax error, unexpected T_VARIABLE in ..\virus_scan.php on line 24
希望一些新鮮的眼睛會帶來一個全新的視角,幫我鑑定的錯誤。 第24行是在$ SQL變量聲明行:
if ($dbs === False)
{
print "can't find $database";
}
//--------------------------------------------------------------------------
// 2) Query database for data
//--------------------------------------------------------------------------
$sql = "select unix_timestamp(date(Date_Found)) * 1000 as day, count(Virus_Name) as nb from machine_virus_info where Virus_name!='NULL' group by unix_timestamp(date(Date_Found)) * 1000 ;"
$result = mysql_query($sql) or die('SQL Error 1: ' . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$array[] =
array (
$row['day'],
$row['nb']
);
}
你錯過了';'在末尾 – 2013-02-26 16:17:39
我知道這很簡單。謝謝...:D – sSmacKk 2013-02-26 16:19:14
沒有問題。只要沒有問題解答,您可以刪除問題(使用「刪除」鏈接) – 2013-02-26 16:19:39