ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

前端 未结 10 607
悲&欢浪女
悲&欢浪女 2021-02-01 04:28

While I am trying to insert a row to my table, I\'m getting the following errors:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that         


        
10条回答
  •  清酒与你
    2021-02-01 05:05

    This error comes when you have a column name from one of the mysql keyword, try to run your queries by putting all your column names in `` this

    example: insert into test (`sno`, `order`, `category`, `samp`, `pamp`, `method`) values(1, 1, 'top', 30, 25, 'Total');

    In this example column name order is a keyword in mysql, so i had to put that in `` quotes.

提交回复
热议问题