Jump to content

List Query Help


spectsteve7

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/32581-list-query-help/
Share on other sites

[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]
Link to comment
https://forums.phpfreaks.com/topic/32581-list-query-help/#findComment-151617
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.