SQL Update增量不起作用

use*_*443 0 php mysql sql increment

我的SQL代码有点小问题:

UPDATE articles SET like=like+1 WHERE id=1
Run Code Online (Sandbox Code Playgroud)

当我尝试在PhpMyAdmin中执行它时,我收到此错误:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like=like+1 WHERE id=1' at line 1
Run Code Online (Sandbox Code Playgroud)

列类似于int默认设置为0(长度为11).有谁知道我该如何修理它?请帮忙.

She*_*ock 5

LIKE是一个关键字,不能用作列名.您可以将其(在您的查询中)更改为`like`=`like`+1(使用反引号),但这很难解决问题.

重命名您的专栏.