Reputation: 1212
I know there are a bunch of questions with this subject but I haven't found my mistake here. I've just started learning SQL.
My query:
CREATE TABLE IF NOT EXISTS `data` (
`id` int(11) NOT NULL auto_increment,
`quizid` int(11) NOT NULL default '0',
`result` int(3) NOT NULL default '0',
`IP` varchar(16) NOT NULL default '',
`ts` timestamp(14) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB ;
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 '(14) NOT NULL,
PRIMARY KEY (`id`)' at line 6
I know the answer must be easy to spot by the right eyes.
Upvotes: 1
Views: 70
Reputation: 5412
timestamp
accepts length but upto 6
precision numbers. But then you need not specify length for timestamp
Upvotes: 3