valcon54 Posted January 24, 2008 Share Posted January 24, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/87653-solved-1064-you-have-an-error-in-your-sql-syntax/ Share on other sites More sharing options...
revraz Posted January 24, 2008 Share Posted January 24, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/87653-solved-1064-you-have-an-error-in-your-sql-syntax/#findComment-448330 Share on other sites More sharing options...
valcon54 Posted January 24, 2008 Author Share Posted January 24, 2008 Thanks for the reply now i understand whats going on. The pain starts now cause i have the edit a bunch of files for the php code to rename ORDER and DATE. Quote Link to comment https://forums.phpfreaks.com/topic/87653-solved-1064-you-have-an-error-in-your-sql-syntax/#findComment-448387 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.