[eluser]Unknown[/eluser]
Hello,
I'm having a bit of a challenge with ci and would appreciate your input. I'm not a php guru but I can write some php code.
I want to populate a dropdown menu with some values from a db
blue shirt ->blue shirt id
red shirt ->red shirt id
I'm using the form helper that expects an assoc array.
The problem is, how do I get the values from the database to be in the form that the form help wants?
My db query is in function get_shirts():
Code:
$rows = $this->db->get('shirts');
The value I'm passing to the view page is:
Code:
$data['options'] = $this->get_shirts():
On my view page I have:
Code:
echo form_dropdown('shirts', $options, 'large');
:bug:
thank you