Join Multiple Tables In Cdbcriteria

Hello. I’m new to Yii and currently having difficulties with creating CActiveDataProvider.

I’ve created this criteria :

		$criteria=new CDbCriteria;





		$criteria->with = array(

			'rT' => array(

					'alias' => 'r',


			'' => array(

					'alias' => 's',

					'joinType' => 'INNER JOIN',

					'condition' => 's.cid = :cid',

					'params' => array(':cid' => $_SESSION['cid']),



When passing the criteria to CActiveDataProvider and viewing at CListView, I get results which ignores the condition. (Suppose to have 10 results, but instead I get all the results.) If I put the condition outside the ‘with’ array, then I’ll get ‘unknown column in where clause’ error.

Any help is highly appreciated.

you should to use the name of the relations which you define in model class instead of the table name.

What is "rT" and ""?