Page 1 of 1

What's wrong with this simple .sql file?

Posted: Wed Dec 15, 2010 4:24 pm
by AliJ

Code: Select all

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

CREATE TABLE `chat` (
  `message_id` int(11) NOT NULL,
  `chat_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  `user_colour` varchar(6) NOT NULL,
  `message text` NOT NULL,
  `bbcode_bitfield` varchar(255) NOT NULL,
  `bbcode_uid` varchar(8) NOT NULL,
  `bbcode_options` tinyint(1) NOT NULL,
  `time` int(11) NOT NULL,
  PRIMARY KEY  (`message_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `chat_sessions` (
  `user_id` mediumint(8) NOT NULL,
  `username` varchar(255) NOT NULL,
  `user_colour` varchar(6) NOT NULL,
  `user_login` int(11) NOT NULL,
  `user_firstpost` int(11) NOT NULL,
  `user_lastpost` int(11) NOT NULL,
  `user_lastupdate` int(11) NOT NULL,
  PRIMARY KEY  (`user_id`),
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

When I import it, I get the 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 'NOT NULL,
`bbcode_bitfield` varchar(255) NOT NULL,
`bbcode_uid` varchar(8) N' at line 7
Your help would be appreciated, thank you.

Ali J.

Re: What's wrong with this simple .sql file?

Posted: Wed Dec 15, 2010 4:37 pm
by AliJ
Nice to see everyone being so helpful :(.

Re: What's wrong with this simple .sql file?

Posted: Wed Dec 15, 2010 5:37 pm
by VladSun
LOL, 13 minutes and nobody helped?!?

Code: Select all

`message text` NOT NULL,
See why syntax highlighting is so important?