Hello, i want to make a drop down menu with options like (40,000$ to 60,000$) how can i do it and what will be the the MySQL statement to achieve such query
thank you :)
rob7591
2:35 am on Nov 26, 2008 (gmt 0)
You will need a select box with your options (I would use this format): <select name="money"> <option value="40000-60000">$40,000 to $60,000</option> </select> Then in your search page:
<? $a = explode('-', $_GET['money']); $min = $a[0]; $max = $a[1]; $query = "SELECT * FROM table WHERE money >= $min AND money <= $max"; mysql_query($max); ?>
get it?
MrFahad
2:44 am on Nov 26, 2008 (gmt 0)
ya sure :) thanks for the help
Anyango
9:28 am on Nov 26, 2008 (gmt 0)
Small Typo, rob7591
$query = "SELECT * FROM table WHERE money >= $min AND money <= $max"; mysql_query($max);
mysql_query($query) not ($max) ;)
[edited by: Anyango at 9:28 am (utc) on Nov. 26, 2008]