EmailArchive Table:
id email_id to from 1 101 uk msm 2 102 uu avc 3 101 rk uk 4 103 xyz abc 5 104 xyz poi 6 104 abc xy
Another simple way get by using findall in yii
$id =101; $comments = EmailArchive::model()->findAll(array("condition"=>"':email_id'=$id")); foreach($comments as $comments_1) { echo "email:".$comments_1['email_id']; }