Yii2 update with multiple conditions
$this->localdb->createCommand() ->update( $this->MYTable, [ 'name' => $el['new'], 'data' => $el['data'], ], [ 'userId', $this->user, 'product_id', $this->productId, 'name', $el['old'], 'created', $el['date'], 'category', $el['cat'], ] ); I tried to use the following command to update a row using multiple where conditions, but it doesn't work for some reason. The documentation doesn't seem to cover this case and doesn't seem to be updated, because the update() method seems to match the updateAll method instead of the update method for some reason (maybe it was updated?). So I was wondering what was the correct way to do this.
You have a syntax error. Try following: $this->localdb->createCommand() ->update( $this->MYTable, [ 'name' => $el['new'], 'data' => $el['data'], ], [ 'userId' => $this->user, 'product_id' => $this->productId, 'name' => $el['old'], 'created' => $el['date'], 'category' => $el['cat'], ] );
Yii2 full calendar custom button?
can't solve 'date' validation with 'max', 'min' properties Yii2
how can i set to page 1 in pagination when i search in gridview in yii2
Using ArrayHelper in view file in Yii2
Uploading Image and Text on the same submit IN YII2
how can I get a value, not key from dropDownList Yii2 [closed]
How to test a REQUEST GET in Acceptance Test
Codeception radio button list
css is not working after uploading the file on server with filezilla
Is Yii2 compatible with PHP 7?
Class 'yii2fullcalendar\models\Event' not found
Allow to get POST data from outter server YII2
Yii2 - How to update textInput Value from DropDownList
Model validate date format
sjaakp/yii2-illustrated-behavior Yii2 extension for image not being saved
Issue In Bootstrap Modal