[Solved] It's Possible Use Updateall For Concat String?

Hi,

i must make a concat string update, like this:


update tbl set a = concat(a,"test") where id=1

It’s possible use yii as this:


MyModel::model()->updateAll(array('a'=><img src='http://www.yiiframework.com/forum/public/style_emoticons/default/huh.gif' class='bbc_emoticon' alt='???' />??),array('id'=>1));

Please help me.

Please fill the question mark

Maybe this:




    MyModel::model()->updateAll(

        array('a'=>new CDbExpression('concat(a, "test")')),

        array('id'=>1));



Use parameters rather than a plain string if you’re concatenating user input.

It works.

Thank you very much.