Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 840
Elembur Avatar asked Jul 12 '26 19:07

Elembur


2 Answers

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
like image 177
Fabio Avatar answered Jul 15 '26 11:07

Fabio


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));
like image 44
echo_Me Avatar answered Jul 15 '26 11:07

echo_Me



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!