CEinNYC Posted December 3, 2010 Share Posted December 3, 2010 Hi all - I'm trying to populate a drop down menu, and the items listed on the drop down menu are four of the field titles (names). Here's what I am playing with.... "intelligence" "speed" "power" and "reserve" are field names (and a series of numbers are stored in each field). (picture of database attached). How do I incorporate mysql_field_name into the mix? <select name="id" style=""> <?php while($row = mysql_field_name($options)):?> <option value="<?php echo $row['id']; ?>"> <?php echo $row['power']." ".$row['intelligence']." ".$row['speed']." ".$row['reserve']; ?> </option> <?php endwhile; ?> </select> Thanks for any advice! Attached is a screen shot of the database. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/220598-mysql_field_name-drop-down-menu/ Share on other sites More sharing options...
Pikachu2000 Posted December 3, 2010 Share Posted December 3, 2010 It isn't really clear what you want this to look like when it renders. How should the <option>s be formatted? Link to comment https://forums.phpfreaks.com/topic/220598-mysql_field_name-drop-down-menu/#findComment-1142694 Share on other sites More sharing options...
CEinNYC Posted December 3, 2010 Author Share Posted December 3, 2010 Thanks for reply. Sure, so picture attached. What I need to happen.. two drop down boxes, one that lists characters, another that lists game play functions. (Essentially I am trying to battle two characters).. (This is for a class). Similar to: http://thesurrealist.co.uk/monster [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/220598-mysql_field_name-drop-down-menu/#findComment-1142698 Share on other sites More sharing options...
CEinNYC Posted December 3, 2010 Author Share Posted December 3, 2010 to add to this... I have the first potion, the names of the characters populating from the database. Now I need the specific FOUR TITLES to populate in the base. Link to comment https://forums.phpfreaks.com/topic/220598-mysql_field_name-drop-down-menu/#findComment-1142699 Share on other sites More sharing options...
fenway Posted December 5, 2010 Share Posted December 5, 2010 Where's the query? Link to comment https://forums.phpfreaks.com/topic/220598-mysql_field_name-drop-down-menu/#findComment-1143280 Share on other sites More sharing options...
fenway Posted December 5, 2010 Share Posted December 5, 2010 You're now onto your 3rd thread. Link to comment https://forums.phpfreaks.com/topic/220598-mysql_field_name-drop-down-menu/#findComment-1143287 Share on other sites More sharing options...
Recommended Posts