Making a dropdown menu from a database |
[eluser]reghan[/eluser]
Hello I am interested in making a dropdown menu which pulls info from the database. Basically I have three possible anwers yes, no, none. I want to pull the answer that is stored in the database and have that value selected in the dropdown. I am new to code igniter and I am not sure how to do this. Any feedback would be great! Thanks!
[eluser]Jason Hamilton-Mascioli[/eluser]
This is a good start. They outline the controller and model setup. http://stackoverflow.com/questions/73172...odeigniter
[eluser]reghan[/eluser]
Thanks for your reply. I think my main question is how do I select a value in the drop down which corresponds with the value being stored in the database. There would be values already in the database and then when a user goes to update there would be multiple dropdowns for each field with the value selected. Thanks again!
[eluser]CroNiX[/eluser]
Code: $data = $this->db->select('id, name')->get('users')->result_array(); |
Welcome Guest, Not a member yet? Register Sign In |