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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -