I have a simple criteria with a single JOIN, when i execute it in php, i got results only from ProjectModel, but when i execute in phpMyAdmin i got result from project_rating table too.
In phpMyAdmin i run this query
SELECT `pr`.*,`p`.* FROM `project` `p` JOIN project_rating AS `pr` ON( `p`.P_Id = `pr`.Project_id ) WHERE 1=1 ORDER BY `p`.P_Add_date DESC
In Php i run this criteria, no results from project_rating table
$projectList = new ProjectModel(); $criteria = new CDbCriteria(); $criteria->alias = "p"; $criteria->select = "`pr`.*,`p`.*"; $criteria->join = "JOIN project_rating AS `pr` ON( `p`.P_Id = `pr`.Project_id )"; $criteria->order = "`p`.P_Add_date DESC"; $this->data["projectList"] = $projectList->findAll( array(),$criteria ); $this->layout = "main"; $this->render('projectList');
I am sorry for my English