Answer the question
In order to leave comments, you need to log in
Yii2 how to do multiple inserts/deletions/updates?
How to select, insert, delete, update data without a loop? And how to exclude updating of fields which have not changed?
Answer the question
In order to leave comments, you need to log in
There is a batch insert in yii2: www.yiiframework.com/doc-2.0/yii-db-command.html#b...
It can be used for multiple inserts
For multiple updates, you can use it, with some modifications (adding ON DUPLICATE KEY UPDATE)
But about mass deletion, probably just IN, like this: ->where(['IN', 'id', $ids])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question