Hi
I am passing in a db col name as a parameter via ajax to a controller. The column name can change. My question is how do I specify to the model what the col name is that I want to update. eg…
$set = Yii::app()->getRequest()->getParam(‘set’); // col name from ajax, will be set to ‘username’ for example
$m = CanoeKayak::model()->find(
array(
‘condition’=>‘user_id=:user_id’,
‘params’=>array(
':user_id' => $this->user_id,
),
)
);
$m->WHAT DO I PUT HERE TO UPDATE THE COL USERNAME FROM $set ABOVE = ‘new value for username’
$m->update();
Hope this is simple
Thanks for any help