MySQL 查询完整性检查,用于更新查询

标签 mysql

我有这个问题

update user_remember_me set
when='2012-07-06 05:44:27',
hash='c8e9d2c0dd156b5c68d0b048e5daa948e6b8fac7'
where user = '21';

我收到这个错误

Error : 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 'when='2012-07-06 05:44:27', hash='c8e9d2c0dd156b5c68d0b048e5daa948e6b8fac7' wher' at line 1

我没有错过这里的连接,我在任何地方都使用过像这样的简单更新,直到现在都没有问题,也许我累了,但这会让我发疯,直到我得到答案

最佳答案

当是mysql中的关键字时,更改列名 或者您可以将其用作

`when`='2012-07-06 05:44:27'

关于MySQL 查询完整性检查,用于更新查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11204825/

相关文章:

php - 我可以在 PHP 中混合使用 MySQL API 吗?

php - 从数据库 ID 导入帖子

MySQL If 条件在 where 子句查询中

php - 并非所有 $_Post 值都会发送到表。

mysql - 优化MySQL中的JOIN查询

php - fatal error : Call to a member function result() on string when building a PHP filtering system

mysql - SQL JOIN 2表使用一列的搜索结果

php - 在 laravel 4 上验证上传图片

java - 从 QueryDSL 生成的 bean 和查询创建模式

php - Bootstrap 表单到数据库