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

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

WBOY
WBOYOriginal
2016-06-13 11:52:531349browse

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

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

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

Statement:
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