- 博客(1)
- 收藏
- 关注
原创 Yii2 使用批量执行sql更新数据库获取影响行数的问题
Yii2 使用sql批量更新数据库获取影响行数的问题 情况1:只执行一条更新语句 $sql = "update table_a set attr1=1 where id = 1;"; echo Yii::$app->db->createCommand($sql)->execute(); 结果:1 (成功更新) 情况2:执行多条语句 $sql = "update table_a set attr1=1 where id = 1; update table_a set attr1=2 whe
2021-09-07 11:47:12 528
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人