0

我正在尝试运行查询脚本来创建横幅表

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
4

1 回答 1

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;
于 2013-01-28T03:04:36.403 回答