Uw formaat zou als volgt moeten zijn:
$options = array(
'small' => 'Small Shirt',
'med' => 'Medium Shirt',
'large' => 'Large Shirt',
'xlarge' => 'Extra Large Shirt',
);
$shirts_on_sale = array('small', 'large');
echo form_dropdown('shirts', $options, 'large');
dit zou opleveren:
<select name="shirts">
<option value="small">Small Shirt</option>
<option value="med">Medium Shirt</option>
<option value="large" selected="selected">Large Shirt</option>
<option value="xlarge">Extra Large Shirt</option>
</select>
REFER HIER
UPDATE
je kunt dit ook proberen als je wilt
MODEL
$this->db->select('airport_code, airport_name');
$this->db->order_by('airport_code', "asc");
$query = $this->db->get('airports');
if($query)
{
$query = $query->result_array();
return $query;
}
CONTROLLER
$query = $this->your_model->your_method();
if($query)
{
$data['myDropdown'] = $query;
$this->load->view('your_view', $data);
}
VIEW - JE DROPDOWN-PROBLEEM
<select>
<?php
foreach($myDropdown as $dd)
echo "<option value='". $dd['your_field'] ."'>". $dd['your_field'] ."</option>";
?>
</select>