dpabla Posted January 6, 2007 Share Posted January 6, 2007 IF any noob wants to know how to simply grab data from your mysql table and generate a pull down with the contents...here ya go[code]<?php$result = mysql_query ("SELECT product_name,subcategory_id FROM productsWHERE subcategory_id = {$_GET['sub_id']}");// printing the list box select commandecho "<div align=center><select name=collection value=''><option value=''>Browse Collection</option><br>";// Array or records stored in variable named $collectionwhile($collection=mysql_fetch_array($result)){$prodname = $collection["product_name"];// Option values are added by looping through the arrayecho "<option value='".$prodname."'>".$prodname."</option>";// Closing of list box }echo "</select>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/33129-solveddynamic-pull-down/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.