how to use updateAll ?

hi guys, how to use the right syntac for updateAll func ?

i try this but its no work




t_post_dump::model()->updateAll(array(array('ID_Post'=>'107'),'condition' => 'ID_Post=\'105\''));



t_post_dump is a dump table to populate id pk from several table.

and ID_Post is a pk in Post table and not autoincrement with varchar type.

i know it’s quite strange to update an pk id, but its the decision of thats smartHead… :angry:

the error is




No columns are being updated for table "t_post_dump".



big thanks to you all…

Check CActiveRecord.updateAll().

It should be:




t_post_dump::model()->updateAll(array('ID_Post'=>'107'), 'ID_Post = 105');



ah, you are right [color="#8B0000"]@andy_s[/color].

thanks a lot for the fast reply as usual.

i think its time for me to take a fresh air. :-*