Jump to content

mySQL error, wrong syntax?


cursed

Recommended Posts

An error appears when I run the following mySQL statement..

 

CREATE TABLE `actions` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `actionid` tinyint(3) unsigned NOT NULL default '0',
  `playerid` smallint(6) NOT NULL default '0',
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  `map` tinyint(3) unsigned NOT NULL default '0',
  `xpos` smallint(5) unsigned NOT NULL default '65535',
  `ypos` smallint(5) unsigned NOT NULL default '65535',
  `parameters` varchar(255) collate latin1_general_ci NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

 

and the error message..

 

 

#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 'collate latin1_general_ci NOT NULL default '',
  PRIMARY KEY   

 

my mySQL version is 4.0.27-standard.

 

 

Help would be appreciated!

 

 

Link to comment
https://forums.phpfreaks.com/topic/85464-mysql-error-wrong-syntax/
Share on other sites

I tried your create on MySQL v5+ and it worked fine as-is.

 

Try removing the "collate latin1_general_ci" before the NOT NULL (you already have collate set for whole table).

 

Look in the manual for the correct syntax:

http://dev.mysql.com/doc/refman/4.1/en/create-table.html

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.