我一直在尋找遍佈互聯網的解決方案,以解決以下錯誤;MySQL語法錯誤; 「檢查對應於你的MySQL服務器版本的手冊..」
"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 'primary, username, password, password2) VALUES (null, 'hello', 'hello', 'hello')' at line 1"
我不知道是怎麼回事。我知道你會問我的代碼所以這裏什麼:
$con = mysql_connect("localhost","root","*****");
if (!$con)
{
die('Server overload, please try again' . mysql_error());
}
mysql_select_db("users", $con);
$sql = "INSERT INTO details (primary, username, password, password2) VALUES (null, '$_POST[username]', '$_POST[password]', '$_POST[password2]')";
if (!mysql_query($sql,$con))
{
die('Error: Server overload, try again' . mysql_error());
}
echo "You have signed up successfully!";
mysql_close($con);
我一直在試圖弄明白周邊的4/5現在幾個小時,並沒有成功。
謝謝,
勞倫斯
我剛剛搜索「您的SQL語法錯誤;請檢查手冊」。也許你只是在搜索整個錯誤?前幾個結果是正確的答案。 – Stephano 2010-02-28 19:48:58