activerecord batch insert in yii2
Yii::$app->db
->createCommand()
->batchInsert('table_name', ['column1','column2', 'column3','column4','column5'],$data)
->execute();
activerecord batch insert in yii2
Yii::$app->db
->createCommand()
->batchInsert('table_name', ['column1','column2', 'column3','column4','column5'],$data)
->execute();
yii2 activerecord bulk insert
// It's usually much easier to use DAO instead of ActiveRecord
// table name, column names, column values
Yii::$app->db->createCommand()->batchInsert('users', ['name', 'age'], [
['Tom', 30],
['Jane', 20],
['Linda', 25],
])->execute();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us