tomfmason Posted June 16, 2006 Share Posted June 16, 2006 I am wondering how I can print product names, from a product table, into a drop down menu? Any suggestions would be greatly apperciated. Quote Link to comment https://forums.phpfreaks.com/topic/12158-pulling-a-drop-down-list-from-a-product-table/ Share on other sites More sharing options...
freakus_maximus Posted June 16, 2006 Share Posted June 16, 2006 Making some assumptions about your table name and column names in your db, this should do it.[code]<select id="productnames" NAME="productnames"><?$result = mysql_query ("SELECT productnames FROM producttable") or die ("Query failed");while($row=mysql_fetch_array($result)){ echo '<option value="' . $row['productname'] . '">' . $row['productname'] . "</option>\n";}?></select></P></TD>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12158-pulling-a-drop-down-list-from-a-product-table/#findComment-46303 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.