syntax error in SQL statement (create table if not exists)

25,325

Solution 1

You are missing to close a paranthesis at the end of the query

CREATE TABLE IF NOT EXISTS ax_storage 
(
    PID INT NOT NULL AUTO_INCREMENT, 
    PRIMARY KEY(PID), Playername VARCHAR(32), 
    Time INT(10), 
    Type INT(6), 
    World VARCHAR(32)
);  -- <- you were missing this one

Solution 2

you forgot ) in the end of query

  CREATE TABLE IF NOT EXISTS ax_storage (PID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(PID), Playername VARCHAR(32), Time INT(10), Type INT(6), World VARCHAR(32));
Share:
25,325
Elembur
Author by

Elembur

Updated on March 21, 2020

Comments

  • Elembur
    Elembur about 4 years
    CREATE TABLE IF NOT EXISTS ax_storage 
    (PID INT NOT NULL AUTO_INCREMENT, 
     PRIMARY KEY(PID), 
     Playername VARCHAR(32), 
     Time INT(10), Type INT(6), 
     World VARCHAR(32);
    

    What is wrong with this SQL statement?

  • Elembur
    Elembur about 10 years
    Works, thanks for helping :)
  • Fabio
    Fabio about 10 years
    You are welcome dude!