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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.