作者rpuppy (funny)
看板PHP
標題[請益] Mysql Syntax Error
時間Sat May 13 23:21:31 2006
最近在更新Mysql資料庫
將mysql版本從3.23更新到4.1
也將php從4.3.4RC1更新到5.0.4
資料庫看起來沒什麼問題
不過在執行PHP程式時 出現以下錯誤
Could not run query: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'check='1'' at line 1
程式碼如下:
$sql="select count(*) from $friend where check='1'";
$result=mysql_query($sql,$db);
if(!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
請問是版本更新所造成的問題嗎? 懇請各位大大回答
謝謝各位!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.116.5.64
1F:推 timyau:你先在MySQL的 Query Browser或Command line下執行SQL指令 05/13 23:35
2F:→ timyau:看看是否正確吧... 05/13 23:35