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?
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