Home > Backend Development > PHP Tutorial > 求 数据库的update语句问题

求 数据库的update语句问题

WBOY
Release: 2016-06-23 14:23:23
Original
1114 people have browsed it

poster的值为2 要怎么批量把poster的值为1
我的数据库语句如下

update user set poster = 1  WHERE poster = 2
Copy after login

但是却报错
Unknown column 'poster' in 'where clause'

要怎么批量把poster的值批量修改为2(原本值为1)


回复讨论(解决方案)

update  `user `  set  `poster `=1 where  `poster `=2

update  `user `  set  `poster `='1' where  `poster `='2'

Unknown column 未知列
请检查字段名是否写错了

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template