How to update/delete two or more specified pieces of data
王先生
王先生 2019-10-31 11:26:08
0
2
1271

How to update/delete two or more specified pieces of data?

I only know that multiple pieces of data with the same conditions can be deleted at the same time. But I don’t know how to delete multiple specified pieces of data at the same time. For example: I want to delete two pieces of data with id=17 and id=16 at the same time. What should I do here?

王先生
王先生

reply all(2)
Simine

The above can also be used, or use this

model('Stus')->where('id', 16)->whereOr('id',17)->delete( );

卢小强

Use WHERE condition to delete. The conditions after WHERE can be connected with AND. There can be multiple, such as delete from user where id=1 and id=2 and id=3

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template