我有一個錯誤在我的SQL語法和無法弄清楚它是什麼:錯誤在SQL語句中
代碼:
$sqlsearch= " SELECT `idNum`,`First_Name`, FROM users WHERE `idNum`= '26130110' AND 'Password' ='$encpass';";
當我運行查詢我得到這個錯誤:
error: 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 'FROM users WHERE `idNum`= '26130110' AND 'Password' ='3fdf7be97917772020f87454f7' at line 1
使用phpmyadmin作爲數據庫。
閱讀並遵循:http://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php?rq=1(在任何情況下,有一個額外的逗號' FROM')。 – user2864740