I have a query that i want to connect to a listbox…the result of query…how can i do???

Help meeee…:slight_smile:

Hi, Kitty

Could you paste in some code for an idea

This is my code

public function actionCreate()


		 $model=new ruoli;




			$connection=new CDbConnection('oci:dbname=//','ora02','oracle');


			$command=$connection->createCommand('select descrizione from ruoli where ruolo_id=ANY(select ruolo_ruolo_id from accesso_ruoli where accesso_accesso_id='.$_GET["id"].')');




			 foreach($reader as $row) 


						$ID[$i]= $row['DESCRIZIONE'];

						echo $ID[$i];







The result i want to put in a listbox…

Depending on which of the 3 list box you use:

public static string [b]listBox[/b](string $name, mixed $select, array $data, array $htmlOptions=array ())

Basically that array $data is what you need to fill.

Use the function listData

The $model can be the result of your query.

Also keep in mind this is how value is set:

Hope that helps.