[請益] Mysql Syntax Error

看板PHP作者 (funny)時間18年前 (2006/05/13 23:12), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串1/2 (看更多)
最近在更新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

05/13 23:35, , 1F
你先在MySQL的 Query Browser或Command line下執行SQL指令
05/13 23:35, 1F

05/13 23:35, , 2F
看看是否正確吧...
05/13 23:35, 2F
文章代碼(AID): #14PVTANf (PHP)
文章代碼(AID): #14PVTANf (PHP)