[eluser]CroNiX[/eluser]
No there isn't. You'd have to do what guzzilar suggested, or create a helper to do it since this is a very common thing and you will probably use it many times.
Code:
function array_to_dropdown($raw_data, $key_field, $value_field)
{
$data = array();
foreach($raw_data as $raw)
{
$data[$raw[$key_field]] = $raw[$value_field];
}
return $data;
}
Usage:
Code:
$values = $this->db
->select('id, name, address, city, state_id')
->get('users')
->result_array();
$dropdown_values = array_to_dropdown($values, 'id', 'name');
echo form_dropdown('my_dropdown', $dropdown_values);