我試圖通過PHP將表單輸入存儲到SQL數據庫中。當我提交表單,我收到以下錯誤:SQL/PHP INSERT錯誤
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 'Describe, Living, City, State, Major) VALUES ('First', 'Last', 'Company ' at line 1".
這是我的PHP:
$insert_sql="INSERT INTO Interns (First, Last, Company, Description,Classes, Interview, Projects, Benefits, Describe, Living, City, State, Major) VALUES ('$first_name', '$last_name', '$company', '$description', '$classes', '$interview', '$projects','$benefits', '$describe', '$living', '$city','$state','$major');";
這個問題已經被問過很多次,可以很容易地被避免,有你谷歌你的語法錯誤,並解釋它來解決你的「保留」字問題。 – 2015-03-30 18:22:05
**警告**:這看起來[恐怖不安全](http://bobby-tables.com/),爲了您的利益,我希望這不在公共互聯網上。您需要確保任何和所有用戶參數[妥善轉義](http://bobby-tables.com/php),否則您將面臨嚴重的應用程序危害風險。只要有可能,請使用準備好的語句和佔位符,以確保您不會遇到此類錯誤。 – tadman 2015-03-30 19:17:57