Yii 1.0 DAO Code Demo

{Code}

//Text Type Choice Hot Map
$sql = "SELECT m.map_type_id, m.map_name, pc.* FROM sc2m_map as m right join sc2m_p_choice_text as pc on m.id=pc.map_id where m.status_type_id = 1 limit 0, 10";
$data_pChoiceText = Yii::app()->db->createCommand($sql)->queryAll();

{Boy Say}

We always use DAO when the situation is complex, and simple AR CRUD is not fit, but remember AR is bigger than DAO from performance and of course AR is easy use and high recommemd.