Trying to create simple table in sql:
CREATE TABLE order (username VARCHAR(20), productid INT, count INT, orderdate VARCHAR(30), price INT);
But i got ERROR 1064 (42000) (syntax).
Trying to create simple table in sql:
CREATE TABLE order (username VARCHAR(20), productid INT, count INT, orderdate VARCHAR(30), price INT);
But i got ERROR 1064 (42000) (syntax).
order
is a reserved word and needs to be escaped with backticks. Or use a different name for your table like orders
CREATE TABLE `order` (...
Try this:
CREATE TABLE _order (username VARCHAR(20), productid INT, count INT, orderdate VARCHAR(30), price INT);
order is a reserved word of mysql. So you cant use it. Refer to this guide. This would help you.
http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords-5-5.html