$images = Yii::app()->db->createCommand()->select('ul.*, imgs.*')
->from('unitlistings ul, images imgs')
->where("ul.refno = imgs.refno AND ul.refno = '$refno'")
->queryall();
In view,
foreach($images as $img){
.................
$srcorig = $img['imageURL'];
.............
The tables unitlistings and images both have a column imageURL. $img[‘imageURL’] refers to the value in the imageURL column of images table. How can I get the imageURL value from the unitlistings table ?