php - Update a field by $model->updateAll in Yii -
i want execute query :
update table_name field=field+1
what i'm trying :
$model->updateall(array("field"=>"field+1"),"id = ".$id);
field integer , , after running code updates 0 .
does syntax wrong $model->updateall
?
do have use function ?
$model->updateall
can't , correct function should use is:
$model->updatecounters(array("field"=>"1"),"id = ".$id);
Comments
Post a Comment