Select Is Beeing Ignore By Cdbcriteria?

Hi,

when I’m using select and a join, then it is ignoring the select statement and returns me all columns.




 $oCriteria = new CDbCriteria;

 $oCriteria->select      = "allphrasesPhrasesPhrases.phrase";

 $oCriteria->condition = 't.phrase=:sPHRASE';

 $oCriteria->params      = array(':sPHRASE' => $sPhrase);

 $oCriteria->with        = array('allphrasesPhrases');

 $oCriteria->group       = "allphrasesPhrasesPhrases.phrase";

 $aResults = Allphrases::model()->findAll($oCriteria);



the code function very well, but I don’t what all columns!

do you know where the problem is?

I can’t see it but you may use this extension to output the raw SQL by your AR




 $oCriteria = new CDbCriteria;

 $oCriteria->select      = "allphrasesPhrasesPhrases.phrase";

 $oCriteria->condition = 't.phrase=:sPHRASE'; //why not $oCriteria->condition = "t.phrase=:sPHRASE"; 

 $oCriteria->params      = array(':sPHRASE' => $sPhrase);

 $oCriteria->with        = array('allphrasesPhrases');

 $oCriteria->group       = "allphrasesPhrasesPhrases.phrase";

 $aResults = Allphrases::model()->findAll($oCriteria);



I have same issue, please help. Possible problem is that I’m trying to get field in select which is defined in two tables.

fouss, there is no meaning changing single quotes with double quotes to help resolve issue.