How i connecta result of a query to dropdownlist???
I have this code
public function actionSearch()
{
$model=new anagrafe;
if(isset($_POST['anagrafe']))
{
$model->attributes=$_POST['anagrafe'];
$cognome = strtoupper( $_POST['cognome']);
$nome= strtoupper($_POST['nome']);
$connection=new CDbConnection('oci:dbname=//10.0.0.227:1521/oraprod','ora02','oracle');
$connection->active=true;
$command=$connection->createCommand("SELECT ANAGRA_ID FROM ANAGRAFE WHERE NOME='$nome' AND COGNOME='$cognome'");
$command->execute();
$reader=$command->query();
foreach($reader as $row)
{
$ID= $row['ANAGRA_ID'];
}
$this->redirect(array('view','id'=>$model->ANAGRA_ID=$ID));
}
$this->render('search',array(
'model'=>$model,));
}
I wish if the variable $ID has more than one result will appear in a dropdownlist or other control where then i can choose which view