spectsteve7 Posted January 2, 2007 Share Posted January 2, 2007 Hi everyone.I'm not so good at PHP so please be kind. In short, I need to create a size selector using a menu dropdown that on submit sends you to a page that displays the results. I will need to have two different lists one for height and once for width. For example, I will be searching for sizes under 5" wide. Then searching for sizes 3" high. I've made menu list before from the database. My previous project once you pull down the menu list it automaticly got the results. Any help on how to create this would be great, or if anyone could send me a tutorial that too would be good.Thanks Quote Link to comment Share on other sites More sharing options...
marcus Posted January 2, 2007 Share Posted January 2, 2007 [code]<?php$sql1 = "SELECT * FROM `width` WHERE `width` < 5";$res1 = mysql_query($sql1);echo "<select name=width>";while($row1 = mysql_fetch_assoc($res1)){echo "<option value=$row1[width]>$row[width] inches</option>\n";}echo "</select>";$sql2 = "SELECT * FROM `height` WHERE `height` < 3";$res2 = mysql_query($sql2);echo "<select name=height>";while($row2 = mysql_fetch_assoc($res2)){echo "<option value=$row[height]>$row[height] inches</option>\n";}echo "</select>";?>[/code] Quote Link to comment Share on other sites More sharing options...
spectsteve7 Posted January 2, 2007 Author Share Posted January 2, 2007 What if I were to have multiple list options like; Width >1 >2 >3 >4 and Height >1 >2 >3 >4 as options? Quote Link to comment 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.