Array to listdata

Im new in Yii and object oriented,i need some help on how to display the data from controller into layout/main.php.The table called branch and i need to display a dropdownlist at the layout.However, it returns error.Please help me.Here is the code,

protected/controllers/BranchController.php:

public static function BranchList()

{


	$myList = "SELECT branch_name FROM branch";


	$rows = Yii::app()->db->createCommand($myList)->queryAll();


	return array($rows);


}

protected/views/layout/main.php:

<?php

	&#036;optd = CHtml::listData(BranchController::BranchList());


	echo CHtml::dropDownList('listname','branch',array(&#036;optd));

?>

hi

see this link

My link

My link

Solved the problem based on the links…tq very much…