im using mysql v3.4.9
im setuping a toplist script and trying to import and sql but getting dat error:
Error
SQL query:
CREATE TABLE `ban_ip` (
`ip` int( 11 ) NOT NULL default '0',
`id` int( 11 ) default '0',
UNIQUE KEY `ip` ( `ip` ) KEY `id` ( `id` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;
MySQL said: Documentation
#[B][COLOR="#FF0000"]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 'KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8' at line 5[/COLOR][/B]
wt i need to change in that code
my orginal code is:
CREATE TABLE `ban_ip` (
`ip` int(11) NOT NULL default '0',
`id` int(11) default '0',
UNIQUE KEY `ip` (`ip`)
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
and getting same erro with dat table also:
CREATE TABLE `top` (
`id` int(11) NOT NULL auto_increment,
`mesto` int(11) NOT NULL,
`name` varchar(40) NOT NULL,
`opisanie` varchar(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `mesto` (`mesto`)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;