avaruusmies Posted May 27, 2008 Share Posted May 27, 2008 Hello, im trying to create a script that would make a form, with a dropdown box and the option values would come from my database. Can you give me some advice how to do this? SELECT name FROM foodmenu WHERE creator="$username" ORDER BY name ASC; My first time asking, so if i miss some necessary info, please ask Quote Link to comment https://forums.phpfreaks.com/topic/107437-dropdown-box-with-values-from-database/ Share on other sites More sharing options...
TLawrence Posted June 5, 2008 Share Posted June 5, 2008 Start by creating the initial part of the <select> tag. Then execute your query and loop through the result set, creating a <option></option> for each row returned. Finish it off by closing the <select> tag. Quote Link to comment https://forums.phpfreaks.com/topic/107437-dropdown-box-with-values-from-database/#findComment-558629 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.