How tp5 updates fields
This article mainly introduces "the way tp5 updates fields". In the daily operation, I believe that many people have doubts about the way tp5 updates fields. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to update fields by tp5". Next, please follow the editor to study!
High version
$test_int = 1 db dump (db ('member')-> field (' uid,login_num,groupid')-> where ('uid',16)-> find ()); $result = db (' member')-> where ('uid',16)-> update ([' login_num'= > Db::raw ("login_num+$test_int"), 'groupid'= > Db::raw ("groupid-$test_int")); dump ($result) Dd (db ('member')-> field (' uid,login_num,groupid')-> where ('uid',16)-> find ())
Lower version
At this point, the study on "how tp5 updates fields" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!