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