Paul Duncan
Paul Duncan

Reputation: 322

MySQL Error with TIMESTAMP

$sql = "CREATE TABLE heros (
ID int NOT NULL AUTO_INCREMENT PRIMARY KEY,
battletag varchar(64) ,
name varchar(32),
id int,
level int,
hardcore bool,
gender bool,
dead bool,
class varchar(32),
updated TIMESTAMP
";

Getting an error:

Error creating table: 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 '' at line 11

Upvotes: 0

Views: 49

Answers (1)

esqew
esqew

Reputation: 44699

You're forgetting your closing ) character. Cleaned:

CREATE TABLE heros (
    ID int NOT NULL AUTO_INCREMENT PRIMARY KEY,
    battletag varchar(64) ,
    name varchar(32),
    id int,
    level int,
    hardcore bool,
    gender bool,
    dead bool,
    class varchar(32),
    updated TIMESTAMP
)

Upvotes: 1

Related Questions