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'], ] );
Trigger Scheduled Events from Yii2
Iam not getting details from user table
Button click yii2
How to authenticate only email during login in yii2?
$enableCsrfValidation = false
How to add a new column to the gridview in yii2?
How to use bitwise in Yii2
Error 504 gateway time-out
How to limit max char on redactor limiter plugin?
How to use the ArrayHelper::multisort() in Yii2
How to pass parameters from view to controller in Yii2
Automatically cut text on length over limiter?
Can't get the parameter passed from view to controller in Yii2
why functional testing does not require waiting time while acceptance testing requires waiting time codeception
error while creating table using Yii2 migration
my export in yii2 using kartik-v/yii2-export not working