Home >Backend Development >PHP Tutorial >怎么批量更新某字段的所有数据?

怎么批量更新某字段的所有数据?

WBOY
WBOYOriginal
2016-06-23 14:00:031289browse

model('abc')->update("id='1'","shuzi=shuzi+1");

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

我想知道按照以上的PHP结构怎么让shuzi字段下所有数字都加上1?


回复讨论(解决方案)

去掉条件 id='1'

model('abc')->update(‘’,"shuzi=shuzi+1");

把id = 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