MySQl Error #1064

旧巷老猫 提交于 2019-11-28 01:49:05
Puaka

maybe you forgot to add ";" after this line of code:

`quantity` INT NOT NULL)

In my case I was having the same error and later I come to know that the 'condition' is mysql reserved keyword and I used that as field name.

At first you need to add semi colon (;) after quantity INT NOT NULL) then remove ** from ,genre,quantity)**. to insert a value with numeric data type like int, decimal, float, etc you don't need to add single quote.

Joseph Rex

Sometimes when your table has a similar name to the database name you should use back tick. so instead of:

INSERT INTO books.book(field1, field2) VALUES ('value1', 'value2');

You should have this:

INSERT INTO `books`.`book`(`field1`, `field2`) VALUES ('value1', 'value2');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!