jj0311 Posted November 20, 2009 Share Posted November 20, 2009 First I want not say I am not really well versed in programming, and appreciate any help. Is it possible to use field values selected from multiple(6) dynamically generated drop down menus on one page to query a database when a button is clicked and then use display the results of the query on another page? If so, what should I do? Also I wanted to allow users to be able to leave fields blank i.e. not select a value from the table for the search...is that possible? Not sure if the code is needed but here is a snipit from the menus and form they are contained in: <form id="search_taste" name="search_taste" method="post" action="tasteNote.php"> <p> <label>Wine <select name="Wine" id="Wine" title="<?php echo $row_rs_Wine['WINE_PROPRIETARY_NAME']; ?>"> <option value="*">All</option> <?php do { ?> <option value="<?php echo $row_rs_Wine['WINE_PROPRIETARY_NAME']?>"><?php echo $row_rs_Wine['WINE_PROPRIETARY_NAME']?></option> <?php } while ($row_rs_Wine = mysql_fetch_assoc($rs_Wine)); $rows = mysql_num_rows($rs_Wine); if($rows > 0) { mysql_data_seek($rs_Wine, 0); $row_rs_Wine = mysql_fetch_assoc($rs_Wine); } ?> </select> </label> </p> <p> <label>Vintage <select name="Vintage" id="Vintage"> <option value="*">All</option> <?php do { ?> <option value="<?php echo $row_rs_Vintage['WINE_VINTAGE']?>"><?php echo $row_rs_Vintage['WINE_VINTAGE']?></option> <?php } while ($row_rs_Vintage = mysql_fetch_assoc($rs_Vintage)); $rows = mysql_num_rows($rs_Vintage); if($rows > 0) { mysql_data_seek($rs_Vintage, 0); $row_rs_Vintage = mysql_fetch_assoc($rs_Vintage); } ?> </select> </label> Link to comment https://forums.phpfreaks.com/topic/182221-using-multiple-drop-down-list-to-query-database/ Share on other sites More sharing options...
jamesxg1 Posted November 20, 2009 Share Posted November 20, 2009 Hiya mate, It seems to me your looking for a chained drop down box, Ajax is the best to use for this google 'free ajax chained multi drop down box' and you should find what you want, Also if you are only looking to use php maybe use $_GET[' '] so show / hide div sections containing the data. James. Link to comment https://forums.phpfreaks.com/topic/182221-using-multiple-drop-down-list-to-query-database/#findComment-961554 Share on other sites More sharing options...
jj0311 Posted November 30, 2009 Author Share Posted November 30, 2009 Thanks for the suggestion Link to comment https://forums.phpfreaks.com/topic/182221-using-multiple-drop-down-list-to-query-database/#findComment-968421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.