Cactivedataprovider With Relations And Scopes - Stucked With Alias Table Names

Im new in yii and , of course <img src='' class='bbc_emoticon' alt=':unsure:' /> , Im stucked with an error and I don`t know how to resolve it. My code is:


$criteria = new CDbCriteria;

$criteria->addSearchCondition('', $town, false);

$criteria->addSearchCondition('', $name, false);

$criteria->addSearchCondition('match_type', $match_type, false);

$dp = new CActiveDataProvider(Match::model()->with('stadium', 'scorer')->played()->victories(), 


		"pagination" => array(

			"pageSize" => Yii::app()->params['matches_per_page']




When I tried this:


I got the following error message:

 Column not found: 1054 Unknown column '' in 'where clause'.

with('stadium', 'scorer')

these are my relations name defined in Match model.

Try setting the together property of your CDbCriteria object to true. This will enable eager loading, that is force a join and allow to refer to the related tables in query conditions.