How to use database rows in a dropdown box? |
[eluser]Sinclair[/eluser]
Hi, I'am gettin nuts on How to do this: Code: function index() How did you list database rows in a dropdown box? Best Regards,
[eluser]cdbrkpnt[/eluser]
Code: $options = array( this is what CI guide says .... http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]Sinclair[/eluser]
Hi, Thanks for the reply. My array from database is: Code: Array ( [0] => Array ( [id_orientacao] => A ) [1] => Array ( [id_orientacao] => B ) [2] => Array ( [id_orientacao] => C ) ) This array does not do what I need. How can I change the array? Best Regards,
[eluser]umefarooq[/eluser]
here is helper i have created for database driven dropdown Code: function form_db_dropdown($data=''){ if you don't have id and name columns in your table then you can have query as like this Code: $sql = 'select col1 as id,col2 as name from table';
[eluser]cdbrkpnt[/eluser]
[quote author="Sinclair" date="1261635797"]Hi, I'am gettin nuts on How to do this: Code: function index() How did you list database rows in a dropdown box? Best Regards,[/quote] Code: function index() Check this once ..
[eluser]gigas10[/eluser]
I do mine like this Code: CONTROLLER |
Welcome Guest, Not a member yet? Register Sign In |