我正在尝试运行查询脚本来创建横幅表
CREATE TABLE IF NOT EXISTS `tan_banners` (
`id` smallint(5) NOT NULL AUTO_INCREMENT,
`banner_tag` varchar(40) NOT NULL DEFAULT ”,
`descr` varchar(200) NOT NULL DEFAULT ”,
`code` text NOT NULL,
`approve` tinyint(1) NOT NULL DEFAULT ’0′,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
但我一直在接受:
error #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 '”, `descr` varchar(200) NOT NULL DEFAULT ”, `code` text NOT NULL, `approv' at line 3
答案 0 :(得分:1)
您在banner_tag
,descr
&的查询中有额外的奇数引号。 approve
命令:
CREATE TABLE IF NOT EXISTS `tan_banners` (
`id` smallint(5) NOT NULL AUTO_INCREMENT,
`banner_tag` varchar(40) NOT NULL DEFAULT ”,
`descr` varchar(200) NOT NULL DEFAULT ”,
`code` text NOT NULL,
`approve` tinyint(1) NOT NULL DEFAULT ’0′,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
试试这个:
CREATE TABLE IF NOT EXISTS `tan_banners` (
`id` smallint(5) NOT NULL AUTO_INCREMENT,
`banner_tag` varchar(40) NOT NULL DEFAULT '',
`descr` varchar(200) NOT NULL DEFAULT '',
`code` text NOT NULL,
`approve` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;