Reputation: 307
I am creating a database for my application. I get this error: MySQL said: Documentation
PRIMARY KEY (UserID))' at line 4 .
This is my sql statement:
CREATE TABLE sitheloChat_Users (
UserID int(10) unsigned NOT NULL auto_increment,
Username varchar(15) NOT NULL default '',
PreviousUpdate timestamp(14) NOT NULL,
PRIMARY KEY (UserID)
);
What must i add or edit?
Upvotes: 0
Views: 6091
Reputation: 5380
TimeStamp doesn't need the length like String (varchar/varchar2).
CREATE TABLE sitheloChat_Users ( UserID int(10) unsigned NOT NULL auto_increment,
Username varchar(15) NOT NULL default '', PreviousUpdate timestamp NOT NULL,
PRIMARY KEY (UserID) );
Upvotes: 1
Reputation: 3759
Remove the (14) from timestamp
mysql> CREATE TABLE sitheloChat_Users
( UserID int(10) unsigned NOT NULL auto_increment,
Username varchar(15) NOT NULL default '',
PreviousUpdate timestamp NOT NULL, PRIMARY KEY (UserID) );
Query OK, 0 rows affected (0.03 sec)
Upvotes: 3