yii2 数据库插入操作怎么传入一个数组
程序员文章站
2023-12-26 23:13:27
...
怎么才能像tp那样save()后面传入数组就可以插入 跟新了...
$customer = new Customer();
$customer->name = 'Qiang';
$customer->save();
回复内容:
怎么才能像tp那样save()后面传入数组就可以插入 跟新了...
$customer = new Customer();
$customer->name = 'Qiang';
$customer->save();
$customer = new Customer();
$customer->setAttributes(['name' => 'Qiang']);
$customer->save();