MySQl Error #1064

前端 未结 4 1087
长发绾君心
长发绾君心 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: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');
    

提交回复
热议问题