Yii2: update field with query builder

前端 未结 6 821
Happy的楠姐
Happy的楠姐 2021-01-07 17:26

How can I update field with query builder in Yii2? I can\'t find this in documentation.

Thanks!

UPD

This is the solution:

         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-07 17:36

    Query builder is for select queries only (sum, max, count too). You should use other methods - AR or raw queries (https://github.com/yiisoft/yii2/blob/master/docs/guide/db-dao.md#basic-sql-queries)

提交回复
热议问题