arun4444 Posted May 22, 2007 Share Posted May 22, 2007 hello, when i try to import sql (spplied with a php nuke mod) i get the following error: Code i am trying to import:- CREATE TABLE nuke_simpleshop ( id int(255) NOT NULL auto_increment, sku varchar(255) NOT NULL default '', name varchar(255) NOT NULL default '', description longtext NOT NULL default '', price varchar(30) NOT NULL default '', image varchar(30) NOT NULL default '', category varchar(30) NOT NULL default '', spotlight varchar(30) NOT NULL default '', condition varchar(30) NOT NULL default '', status varchar(30) NOT NULL default '', provider varchar(30) NOT NULL default '', contact varchar(30) NOT NULL default '', deal varchar(30) NOT NULL default '', hits int(255) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM; Error I get:- MySQL said: Documentation #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 'condition varchar(30) NOT NULL default '', status varchar(30) NOT NULL default ' at line 10 Quote Link to comment https://forums.phpfreaks.com/topic/52507-mysql-table-creation-problum-any-help-much-appreciated/ Share on other sites More sharing options...
Wildbug Posted May 22, 2007 Share Posted May 22, 2007 There are some reserved keywords in MySQL. I believe "status" is one of them. Use backticks around that word to use it as a column name (`status`, backticks, shift-tilde~, not single quotes). Check the manual for a list of reserved words. Quote Link to comment https://forums.phpfreaks.com/topic/52507-mysql-table-creation-problum-any-help-much-appreciated/#findComment-259185 Share on other sites More sharing options...
AndyB Posted May 22, 2007 Share Posted May 22, 2007 Actually, it's condition that's the reserved word. I'd recommend using a different name rather than `backticks`. For reference, the complete list ->http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Quote Link to comment https://forums.phpfreaks.com/topic/52507-mysql-table-creation-problum-any-help-much-appreciated/#findComment-259441 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.