MySQl Error #1064

前端 未结 4 1061
长发绾君心
长发绾君心 2020-12-07 01:00

I keep getting this error:

MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server vers

相关标签:
4条回答
  • 2020-12-07 01:10

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

    `quantity` INT NOT NULL)
    
    0 讨论(0)
  • 2020-12-07 01:12

    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.

    0 讨论(0)
  • 2020-12-07 01:22

    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');
    
    0 讨论(0)
  • 2020-12-07 01:23

    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.

    0 讨论(0)
提交回复
热议问题