Simply said, I am trying to do this:
$widgetsUsed->updateAll(array(
'position'=>'- 1'
),
"position > {$position} AND sidebar_id = {$sidebar_id}"
);
Does anyone have a clue if this works, or give some other suggestions how to achieve this?
Having a hard time to debug this since I can’t exactly make up what values are chaning when in my database. So I was hoping anyone here would directly know how to do this.
Thanks in advance
You can try as below
If you have
higher version of Yii, then you can use http://www.yiiframework.com/wiki/282/using-counters-with-activerecord/