SQL concatenate in YII

Hi, all. I’m learning how to use Yii framework. I’m developing a demo project to apply it. However, I have the following problem:

I want to insert new information into MySQL tables. One section of this information is related with the fullname of the users of the system. However I haven’t could find information how to CONCATENATE the firstname and the lastname of the users into one field to show in the _form.php correctly. I checked the DAO information but I didn’t find anything related with this.

Any ideas?

TIA

Cheers

Monico




class MyModel extends CActiveRecord

{

    public $fullname;


    ...

}






$criteria->select = 'foo, bar, CONCAT(firstname, lastname) AS fullname';

$models = MyModel::model()->findAll($criteria);



I think this short example is enough to understand the idea :)

Hi, Andy. I appreciate your time to help me to understand better Yii and all Programming stuff related. Thanks!

Cheers

Monico