user2016815
user2016815

Reputation: 13

PHPMyAdmin sql query ERROR 1064

I am trying to run a query script to create a table for banners

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;

But I keep getting:

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

Upvotes: 0

Views: 581

Answers (1)

Giacomo1968
Giacomo1968

Reputation: 26066

You have extra odd quotes in the query on the banner_tag, descr & approve commands:

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;

Try this:

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;

Upvotes: 1

Related Questions