Spring JDBC BadSqlGrammarException: MySQL Syntax Error in UPDATE Statement
This error is caused by a syntax error in your SQL statement. Specifically, there seems to be an issue with the syntax near the 'order=0, authorId=1, template='1', type='post', commentsNum=1, allowComment='1' at line 6'.
Based on the given SQL statement, it seems that you are trying to update a row in the 'typecho_contents' table. However, there is a problem with the syntax used for setting the values of the columns.
The error is likely occurring because 'order' is a reserved keyword in MySQL. To avoid this issue, you should enclose the 'order' column name in backticks like this: order.
Here's the corrected SQL statement:
UPDATE typecho_contents SET title=?, slug=?, created=?, modified=?, text=?, `order`=?, authorId=?, template=?, type=?, commentsNum=?, allowComment=?, allowPing=?, allowFeed=?, parent=?, views=?, agree=? WHERE cid=?
To fix this issue, you should review the SQL statement and ensure that the syntax used for setting the values is correct. Check for any missing or misplaced commas, quotes, or other syntax errors. Additionally, make sure that the column names and values are specified correctly.
Once you have corrected the syntax errors in your SQL statement, the error should be resolved.
原文地址: https://www.cveoy.top/t/topic/qoHZ 著作权归作者所有。请勿转载和采集!