Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    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

    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

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    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.

  • #3
    New Coder
    Join Date
    Feb 2008
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •