"Table Creat" problem in SQL Expert Help plz

Started on the old forum in April 2012 · view the original in the archive · old links redirect here

4 replies · 437 views · started 14 years ago · 1 min read

2 participants
BDplanet Junior · 37 posts #1

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 ;

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close