Help On Dropdown List

Hi all,

I’m trying to populate values to a dropdown list. The value is taken from a table. Using the code below, I can only get 1 value from the table although there should be several values that should be displaying.

echo $form->dropDownList($model,‘vendbus’, CHtml::listData(padcd::model()->findAll(‘reftyp =:business’,array(’:business’ => ‘business’)), ‘reftyp’,‘refval’), array(‘empty’=>‘select Type’)); ?>

Thanks in advance

Hi, userp

Please use code formatting next time.

You’re filling array having one key only: ‘business’. Obviously, you’ll have one value only in such array ;)

[color="#006400"]/* Moved from "Yii-powered Applications" to "General Discussion for Yii 1.1.x" */[/color]