Jump to content

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

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.