update mutiple records with increament of its own value


I want to update a set of records to increase some columns value.

I tried this:

$command = Yii::app()->db->createCommand();


but there is a problem using this expression: ‘rgt’=>rgt+2, errors: Use of undefined constant rgt,

can anybody suggest how I could compose this query?

many thanks.

I have found another way to do this, but it seems not working. can anybody help please? many thanks.


it is solved,there is a mistake: