Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-05-2009, 12:10 AM   PM User | #1
Money88
New Coder

 
Join Date: Feb 2008
Posts: 14
Thanks: 3
Thanked 0 Times in 0 Posts
Money88 is an unknown quantity at this point
Error while creating table [was: Help?]

Is there anything wrong with this code snippet?

Code:
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

Quote:
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.

Last edited by guelphdad; 03-05-2009 at 12:20 AM.. Reason: create meaningful headline
Money88 is offline   Reply With Quote
Old 03-05-2009, 12:18 AM   PM User | #2
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
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.
guelphdad is offline   Reply With Quote
Old 03-05-2009, 12:31 AM   PM User | #3
Money88
New Coder

 
Join Date: Feb 2008
Posts: 14
Thanks: 3
Thanked 0 Times in 0 Posts
Money88 is an unknown quantity at this point
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.
Money88 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:16 PM.


Advertisement
Log in to turn off these ads.