Updatecounters Error

don’t work because don’t bind the :pos param and return one error from the query




Section::model()->updateCounters(

	array('position'=>-1),

	array('condition' => 'position > :pos'),

	array(':pos' => $position)

);



this one work but i don’t bind nothing




Section::model()->updateCounters(

	array('position'=>-1),

	array('condition' => 'position > '.$position),

	array()

);



In the first one I do some errors?

Thanks.

I shouldn’t think it would make any difference, but try




Section::model()->updateCounters(

    array('position'=>-1),

    array(

        'condition'=>'position > :pos',

        'params'=>array(':pos'=>$position),

    )

);



I think suggested code by “Keith” will work… :D

it works, thank you very much!