Home > Backend Development > PHP Tutorial > 如何批量更新某字段的所有数据

如何批量更新某字段的所有数据

WBOY
Release: 2016-06-13 11:52:53
Original
1372 people have browsed it

怎么批量更新某字段的所有数据?
model('abc')->update("id='1'","shuzi=shuzi+1");

如上是更新abc表,id为1,字段为shuzi的数字上加上1。

我想知道按照以上的PHP结构怎么让shuzi字段下所有数字都加上1?
------解决方案--------------------
去掉条件 id='1'
------解决方案--------------------
model('abc')->update(‘’,"shuzi=shuzi+1");

Related labels:
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