update mutiple records with increament of its own value

Hi,

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

I tried this:


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

$command->update('file',array('rgt'=>rgt+2),array('rgt'>=$_POST['File']['rgt']));

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.


File::model()->updateCounters(array('rgt'=>2),'rgt>=:rgt',array(':rgt='.$rgt));

it is solved,there is a mistake:


File::model()->updateCounters(array('rgt'=>2),'rgt>=:rgt',array(':rgt'=>$rgt));