Jump to content

[SOLVED] #1064 - You have an error in your SQL syntax;


valcon54

Recommended Posts

Hello everyone.

Setup;

MySQL client version: 4.1.22

Server version: 4.1.22-standard

MySQL charset: UTF-8 Unicode (utf8)

phpMyAdmin - 2.11.0

 

 

Error

SQL query:

 

# --------------------------------------------------------

#

# Table structure for table `site_menu`

#

CREATE TABLE site_menu(

 

id int( 255 ) NOT NULL AUTO_INCREMENT ,

FILE text,

date int( 255 ) default NULL ,

ORDER int( 255 ) default NULL ,

PRIMARY KEY ( id )

) TYPE = MYISAM ;

 

 

 

MySQL said: 

 

#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 'order int(255) default NULL,

  PRIMARY KEY  (id)

) TYPE=MyISAM' at line 5

 

I exported the sql data from one server running and older version and now im getting this error and dont understand how to fix it. I was told that ORDER is a reserved word that is causing this error.

 

any suggestions on how to fix this

 

Change your field name ORDER to something else since it's a reserved word.  You could use backticks around it, but you really should change it because you will be doing querries ORDER BY and you may confuse yourself.

 

Also, change the field name DATE too.

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.