My CREATE TABLE doesn't work! Please help.

Discussion in 'MySQL' started by MikeHayes, May 21, 2010.

  1. #1
    Hi,

    The code below runs, does nothing and the system gives the message following the code. Can anybody tell me what I'm missing?

    Thanks,

    Mike

    $query = "
    CREATE TABLE keywordstab
    (
    keyword VARCHAR(25) NOT NULL,
    booknr INT (6) NOT NULL,
    PRIMARY KEY(keyword)
    )";

    "#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 '$query = " CREATE TABLE keywordstab ( keyword VARCHAR(25) NOT NUL' at line 1"


    My CREATE TABLE doesn't work!
     
    MikeHayes, May 21, 2010 IP
  2. Crazy_Rob

    Crazy_Rob I seen't it!

    Messages:
    13,157
    Likes Received:
    1,366
    Best Answers:
    0
    Trophy Points:
    360
    #2
    try this

    CREATE TABLE keywordstab
    (
    keyword VARCHAR(25) NOT NULL,
    booknr INT (6) NOT NULL,
    PRIMARY KEY(keyword))
     
    Crazy_Rob, May 21, 2010 IP