Format Anda harus seperti ini:
$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');
ini akan menghasilkan:
<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 DI SINI
PERBARUI
Anda juga bisa mencoba ini jika mau
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;
}
PENGENDALI
$query = $this->your_model->your_method();
if($query)
{
$data['myDropdown'] = $query;
$this->load->view('your_view', $data);
}
LIHAT - MASALAH DROPDOWN ANDA
<select>
<?php
foreach($myDropdown as $dd)
echo "<option value='". $dd['your_field'] ."'>". $dd['your_field'] ."</option>";
?>
</select>