I need to add new custom fields in a certain application, many of which are enabled by drop down menus. I already found out how to add custom fields. (Coppermine Gallery is the application I want to modify, and I already found out how to add custom fields; http://coppermine-gallery.net/forum/index.php?topic=35263.0) However, I'm not so sure how I go about enabling drop down menus. I suppose that I need to create a drop down menu like the followng: <select name="cmdeyecolor" id="cmdeyecolor" style="WIDTH: 158px" alt="REQ|SELECT||Please Select Your Eye Color"> <option selected="selected" value="">Select</option> <option value="Blue">Blue</option> <option value="Brown">Brown</option> <option value="True Green">True Green</option> <option value="Hazel">Hazel</option> <option value="Grey Blue">Grey Blue</option> <option value="Black / Dark">Black / Dark</option> </select> Code (markup): or the following: <select name="cmdeyecolor" id="cmdeyecolor" style="WIDTH: 158px" alt="REQ|SELECT||Please Select Your Eye Color"> <option selected="selected" value="">Select</option> <option value="1">Blue</option> <option value="2">Brown</option> <option value="3">True Green</option> <option value="4">Hazel</option> <option value="5">Grey Blue</option> <option value="6">Black / Dark</option> </select> Code (markup): I don't know exactly how I should set up the database schema. I don't know the most ideal way to do this. q1. Exactly when should I store values in numerical or alphabet? q2. When I pull out this data, if they are stored in numerical or alphabet, how should I convert them to texts? Using database? Using database? What's the best way to approach this?
There are a lot of sub questions there that you would need to consider.... a number will take less space than a character string but does mean you have to have a method of converting a number back into a meaningful response. Text on the other hand will allow easier partial queries (eg who has blue-ish eyes this returning blue, grey blue, blue green etc) but with this number of options it wouldnt be too difficult to look up the different value numbers. The third option is to use both. Have a table called something like "eye colour" which has eyecolourID and the eyecolour - in the existing table store the ID value (have it as a foreign key if you want to ensure db integrity) and then in queried you can simply join the two tables or have a view with the join.