I want to update my table/model. The scenario is, I have a 'status' column, I want to SET this column to a value then update the model based on the id. I want to do something like update statement.
Update 'table' SET status = 'status value' where id = 'myid'
My action controller look like
$model = $this->findModel($id);
$ogp_id = $model->id;
$status = $model->status;
I have searched for it but couldn't find a solution
Any help would be highly appreciated
This Works for me
I added a function
Then access it inside the controller
Then while saving my model I have done the following
This has updated my table and set the column as required