📜  yii2 activerecord 批量插入 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:42.753000             🧑  作者: Mango

代码示例2
// 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();