在数据库中正确创建的所有表中,下面的表让我抓狂,无法获取!
非常感谢您帮助破译错误。
"DROP TABLE IF EXISTS `content_pages`;",
"CREATE TABLE content_pages (
id int(10) NOT NULL auto_increment,
category int(10) NOT NULL default '0',
title varchar(200) NOT NULL default '',
page blob NOT NULL,
page_type varchar(20) NOT NULL default '',
display_in_theme int(5) NOT NULL default '0',
html_header int(5) NOT NULL default '0',
reads int(10) NOT NULL default '0',
PRIMARY KEY (id)
) ENGINE = MyISAM;",
错误报告:
Database Queries
Query: CREATE TABLE content_pages ( id int(10) NOT NULL auto_increment, category int(10) NOT NULL default '0', title varchar(200) NOT NULL default '', page blob NOT NULL, page_type varchar(20) NOT NULL default '', display_in_theme int NOT NULL default '0', html_header int NOT NULL default '0', reads int NOT NULL default '0', PRIMARY KEY (id) ) ENGINE = MyISAM;
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 'reads int NOT NULL default '0', PRIMARY KEY (id) ) ENGINE = MyISAM' at line 9
注意:
我尝试删除 int (5) 和 int (10) 引用;也没有用。
最佳答案
reads
是 reserved keyword in MySQL需要用反引号转义。
`reads` int(10) NOT NULL default 0,
关于php - MySQL ERROR 1064 无法弄清楚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29819254/