我用的是MySQL5。5创建表的原代码如下:
CREATE TABLE news(
'ID' bigint(20) unsigned NOT NULL auto_increment,
'BoardID' int(10) unsigned NOT NULL default '0',
'Title' varchar(100) NOT NULL default '',
'Editor' varchar(45) NOT NULL default '',
'FirstFrom' varchar(100) NOT NULL default '',
'Author' varchar(45) NOT NULL default '',
'Department' varchar(45) NOT NULL default '',
'Keyword' varchar(100) NOT NULL default '',
'NewsFilePath' varchar(100) NOT NULL default '',
'Content' varchar(1024) NOT NULL default '',
'PublishDate' bigint(20) unsigned NOT NULL default '0',
'DCount' int(10) unsigned NOT NULL default '0',
'IfHot' tinyint(3) unsigned NOT NULL default '0',
'IfTop' tinyint(3) unsigned NOT NULL default '0',
'Type' tinyint(3) unsigned NOT NULL default '0',
'PicID' int(10) unsigned NOT NULL default '0',
PRIMARY KEY ('ID')
CREATE TABLE news(
'ID' bigint(20) unsigned NOT NULL auto_increment,
'BoardID' int(10) unsigned NOT NULL default '0',
'Title' varchar(100) NOT NULL default '',
'Editor' varchar(45) NOT NULL default '',
'FirstFrom' varchar(100) NOT NULL default '',
'Author' varchar(45) NOT NULL default '',
'Department' varchar(45) NOT NULL default '',
'Keyword' varchar(100) NOT NULL default '',
'NewsFilePath' varchar(100) NOT NULL default '',
'Content' varchar(1024) NOT NULL default '',
'PublishDate' bigint(20) unsigned NOT NULL default '0',
'DCount' int(10) unsigned NOT NULL default '0',
'IfHot' tinyint(3) unsigned NOT NULL default '0',
'IfTop' tinyint(3) unsigned NOT NULL default '0',
'Type' tinyint(3) unsigned NOT NULL default '0',
'PicID' int(10) unsigned NOT NULL default '0',
PRIMARY KEY ('ID')
)ENGINE=InnoDB DEFAULT CHARSET=gbk;
出现的错误提示如下:
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' bigint(20) unsigned NOT NULL auto_increment,
'BoardID' int(10) unsigned N' at line 2
我怀疑是不是MySQL不支持bigint这种数据类型