...

View Full Version : Error while creating table [was: Help?]



Money88
03-05-2009, 01:10 AM
Is there anything wrong with this code snippet?


CREATE TABLE squad_rank (
rankid int(11) NOT NULL auto_increment,
rankname varchar(100) NOT NULL default '',
order tinyint(4) NOT NULL default '0',
PRIMARY KEY (rankid),
FULLTEXT KEY rankname (rankname)
) TYPE=MyISAM;

It keeps giving me the error


Error at the line 7: ) TYPE=MyISAM;
Query: CREATE TABLE squad_rank (
rankid int(11) NOT NULL auto_increment,
rankname varchar(100) NOT NULL default '',
order int(4) NOT NULL default '0',
PRIMARY KEY (rankid),
FULLTEXT KEY rankname (rankname)
) TYPE=MyISAM;
MySQL: 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(4) NOT NULL default '0', PRIMARY KEY (rankid), FULLTEXT KEY rankn' at line 4

Any help is appreciated thank you.

guelphdad
03-05-2009, 01:18 AM
ORDER is a reserved word, change the column name.

on another note, why make a column not null (rankname) but then allow blank values?

also note please take the time to create a thread title that will describe what the thread is about.

Money88
03-05-2009, 01:31 AM
Alright next time i will be sure to make a useful title. Thanks worked great!
As for the NULL thing not sure. It's not my database I am just in charge of transferring a website from one host to another and the upload kept getting stuck there and I couldn't figure it out...

Thanks again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum