Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

mysql syntax error

Options
  • 17-04-2006 4:53pm
    #1
    Registered Users Posts: 3,514 ✭✭✭


    This mysql code
    CREATE TABLE tblClickthroughRates(
    id int (25) NOT NULL AUTO_INCREMENT ,
    rate varchar (10) ,
    PRIMARY (id)
    ) 
    

    is rendering this error
    #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 '(ID)
    )' at line 4

    mmmmm, why? :confused:


Comments

  • Registered Users Posts: 4,478 ✭✭✭wheres me jumpa


    Is 25 too big a field length for int?


  • Registered Users Posts: 43,931 ✭✭✭✭Basq


    Should be "PRIMARY KEY"
    CREATE TABLE tblClickthroughRates(
    id int (25) NOT NULL AUTO_INCREMENT ,
    rate varchar (10) ,
    PRIMARY KEY (id)
    )
    

    That should do it!


  • Registered Users Posts: 3,514 ✭✭✭Rollo Tamasi


    arrgggg! shoot me in the head now!
    i should really get some sleep

    thanks basquille


  • Registered Users Posts: 19,396 ✭✭✭✭Karoma


    CREATE TABLE tblClickthroughRates(
    id int( 25 ) NOT NULL AUTO_INCREMENT ,
    rate varchar( 10 ) ,
    [b]PRIMARY KEY [/b]( id )
    )
    

    Probably more wrong but that jumps out...


    ed: damn lag :)


  • Registered Users Posts: 43,931 ✭✭✭✭Basq


    arrgggg! shoot me in the head now!
    i should really get some sleep

    thanks basquille
    No problem.. and yes, even the smallest things can get you with a lack of sleep! :D


  • Advertisement
Advertisement