CodeIgniter Forums
Drop-down return MYSQL results - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived General Discussion (
+--- Thread: Drop-down return MYSQL results (/thread-59473.html)

Drop-down return MYSQL results - El Forum - 10-09-2013

Good morning,

I am new to Code Ignitor and rather new to PHP as well so I appreciate your assistance to begin with.

I have a drown-down menu (hard coded with options) that stores the results in a table. My question is if I go back to edit those results they of course default back to the hard coded order. How do I make the drop-down display the option that was originally selected and stored in the DB?

<select name="client_type">
<option name="client_type" value="Retail">Retail</option>
<option name="client_type" value="Ad Speciality">Ad Speciality</option>
<option name="client_type" value="Combination">Combination</option>

Drop-down return MYSQL results - El Forum - 10-09-2013

Look at the form helper, specifically the form_dropdown() function.