Blogger Information
Blog 65
fans 1
comment 1
visits 118882
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
tp5 自增字段并且更新字段
技术宅的博客
Original
1131 people have browsed it

主要还是看手册

tp5手册更新

Db::name('user')
 ->where('id',2) // 条件
 ->inc('age') // 增加的字段 默认1
 ->dec('grade') // 减少的字段 默认1 ->dec('grade',5) 减少 5
 ->update(['update_time'=>time()]); // 更新字段


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post