[eluser]Guillem[/eluser]
I am trying to fill a dropdown in a form with some data in my db.
I get the id and the name of the elements in the table I want to show in my dropdown and I pass them to the view:
Code:
$this->db->select('id, nombre');
$data['operadoras'] = $this->db->get('operadoras');
Then, I would like to create an array with id and nombre, but I cannot figure it up how. I tried something like that
Code:
array(
foreach ($operadoras->array_result() as $row):
$row->id => $row->nombre,
endforeach;);
but definitely it's not working.
Is there any function in the helpers of CI to make what I want to? If not, how can I make it?
Thank you all