Page 1 of 1

best way to populate 'select' box options on forms?

Posted: Thu Nov 23, 2006 6:06 am
by ant_sutton
Hi guys.

I have a series of select boxes on a form. I am currently generating the values to be shown in the select box by assigning an array with the values to a variable in the php script and then using that variable for the 'options' of the select. Is this the best way to do this? I could also create a database table with the options in and query the database everytime the script is ran. I'm thinking this is less efficient though?

I also want users to be able to add new options to the select box too so I need to considetr which method makes this easier.

thanks for any help

Anthony

Posted: Thu Nov 23, 2006 10:25 am
by John Cartwright
if your making a GUI where your client can modify the fields, then use a database. Editing the files directly will only lead to nightmares.

re

Posted: Thu Nov 23, 2006 10:28 am
by ant_sutton
Hi. thanks for your reply jcart. I didnt think it through properly. It will be a GUI where the user can add new options so I think the only way would be to use a DB. thanks alot