I want to create a tb_order database table, but I don't know which code format is wrong.
CREATE TABLE tb_order (
id INT(11) NOT NULL AUTO_INCREMENT,
user_id INT(11) DEFAULT NULL,
order_number VARCHAR(255) DEFAULT NULL,
CREATE DATETIME DEFAULT NULL,
updated DATETIME DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=INNODB AUTO_INCREMENT=2 DEFAULT
CHARSET=utf8;
Error message displayed
Query : CREATE TABLE tb_order ( id int(11) NOT NULL AUTO_INCREMENT, user_id int(11) DEFAULT NULL, order_number varchar(255) DEFAULT NULL... Error Code : 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 'create datetime DEFAULT NULL, updated datetime DEFAULT NULL, PRIMARY KEY (id) ) ' at line 5 Execution Time : 00:00:00:000 Transfer Time : 00:00:00:000 Total Time : 00:00:00:000
createdinstead ofcreatefor a column name. - lurker