Hi there,
I want to use a database output in a dropdown box but can’t do the magic with array’s.
how dos that work?
I have this in the controler:
$sql = “SELECT inst_id, inst_rument”
. “\nFROM instr”
. “\nORDER BY inst_rument”;
$query = $this->db->query($sql);
// DATA ARRAY
$data = array(
// laden queries,
‘query’=> $query
);
$this->load->view(‘page’, $data);
</php>
And this code to load the array in de view file
<? echo form_dropdown(‘instrumenten’, $query); ?>
and i used:
<? echo form_dropdown(‘instrumenten’, $query->result_array()); ?>
I get the dropdown list but only showing array or object.
How to do this?
thanks!
