1064: 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 '(id, name, url, content, category) INTO articles VALUES (null, 'Names', 'names', 'text' at line 1
PHP代碼:
$sql = "INSERT (id, name, url, content, category) INTO articles
VALUES (null, '$name', '$url', '$content', '$category')";
$insert = MySQL_Query($sql);
和MySQL數據庫表:
id PRIMARY tinyint(20) UNSIGNED AUTO_INCREMENT
name varchar(255) utf8_general_ci
url varchar(255) utf8_general_ci
content longtext utf8_general_ci
category varchar(255) utf8_general_ci
1064:你的SQL語法錯誤;檢查與您的MySQL服務器版本相對應的手冊,以便在'(id,name,url,content,category)附近使用正確的語法INTO articles VALUES(null,'Names','names','text'in line 1 – Jacob
字段列表出現在表名後面。參見[here](http://www.w3schools.com/sql/sql_insert.asp) –
如果這些變量來自用戶輸入,請確保您正在轉義它們,或者更好地使用準備好的語句。 – chris85