Reputation: 601
another query gone wrong!
I am trying to INSERT INTO anretOrders (order, orderNumber) VALUES ('test', 15)
Now, the anretOrders table has 3 columns, but one is the id so i am leaving that out since it auto-increments. The other is "order" which is a text column, and orderNumber which is an int.
I cannot, for the life of me, figure out what is wrong here? what am i missing?
Upvotes: 0
Views: 47
Reputation: 13484
order
is a Reserved Words
So try like this
create table anretOrders (`order` varchar(20),orderNumber int);
INSERT INTO anretOrders (`order`, `orderNumber`) VALUES ('test', 15)
Upvotes: 0
Reputation: 6344
escape the field names since order
is a keyword in mysql
INSERT INTO anretOrders (`order`, `orderNumber`) VALUES ('test', 15)
Upvotes: 4