Search code examples
mysqlsqlphpmyadminmysql-error-1064

mysql error 1064


Im trying to create a table with this code:

CREATE TABLE IF NOT EXISTS `entries` (
  `id` int(10) NOT NULL auto_increment,
  `atom_id` varchar(512) NOT NULL,
  `title` varchar(256) NOT NULL,
  `author` varchar(128) NOT NULL,
  `link` varchar(512) NOT NULL,
  `content` longtext NOT NULL,
  `updated` varchar(25) NOT NULL,
  `inserted` varchar(25) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `atom_id` (`atom_id`),
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `topics` (
  `id` int(10) NOT NULL auto_increment,
  `status` varchar(32) NOT NULL,
  `hub` varchar(512) NOT NULL,
  `topic` varchar(512) NOT NULL,
  `lease` varchar(25) NOT NULL,
  `secret` varchar(256) NOT NULL,
  `token` varchar(40) NOT NULL,
  `date` varchar(25) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

but i got this 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 ') ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1' at line 12 

I can't figure what's going on, any advice?


Solution

  • Remove the comma after UNIQUE KEY 'atom_id' ('atom_id'), in line 11