I am writing a form, which has a select menu in it, I want the values to pulled from the database, so I thought it would be something along these lines:
My view
In your view, you can add foreach there instead of in Model.
result_array() as $row){ $data[$row['id']]=$row['name']; echo form_dropdown('categories', $row); } echo form_submit('category_submit', 'Submit'); echo form_fieldset_close(); echo form_close(); ?>
Not tested.