iceblox Posted May 31, 2007 Share Posted May 31, 2007 Hi Guys, I have no code to post as of yet, just want to know whats going to be the best route to take. Im going to have 3 or 4 drop down boxes each one allowing the user to define the search in differnt ways. Whats going to be the best way to carry the variables? Im thinking the post method but not sure. Any ideas? Cheers Quote Link to comment https://forums.phpfreaks.com/topic/53759-solved-multiple-search-queries/ Share on other sites More sharing options...
pocobueno1388 Posted May 31, 2007 Share Posted May 31, 2007 Yes, I would say use the post method...what other way were you thinking? Drop down boxes carry post variables, so that would probably be the best way to go. Quote Link to comment https://forums.phpfreaks.com/topic/53759-solved-multiple-search-queries/#findComment-265698 Share on other sites More sharing options...
iceblox Posted May 31, 2007 Author Share Posted May 31, 2007 Im not sure why i put that lol i must be working to hard lol So using this on the results page $_POST["netid"] will grab the info from that drop down? Quote Link to comment https://forums.phpfreaks.com/topic/53759-solved-multiple-search-queries/#findComment-265703 Share on other sites More sharing options...
pocobueno1388 Posted May 31, 2007 Share Posted May 31, 2007 Well...I don't know what your code looks like, but if you named your drop-down "netid" then yes, that is the info it will grab. Quote Link to comment https://forums.phpfreaks.com/topic/53759-solved-multiple-search-queries/#findComment-265720 Share on other sites More sharing options...
iceblox Posted May 31, 2007 Author Share Posted May 31, 2007 Apologies for the last message being a bit blunt. But it is working now! All is good apart from if i use a > "greater than" clause or "less than" < it does actually that but misses out the same value. F.A.O if i put minimum price as 10000 and max as 75000. The script would miss out any results with a price of 10000 and any of 75000. Here is the code. $query = "SELECT * FROM test WHERE area_id='$_POST[area_id]' AND beds>'$_POST[beds]' AND price>'$_POST[min]'"; Quote Link to comment https://forums.phpfreaks.com/topic/53759-solved-multiple-search-queries/#findComment-265738 Share on other sites More sharing options...
pocobueno1388 Posted May 31, 2007 Share Posted May 31, 2007 F.A.O if i put minimum price as 10000 and max as 75000. The script would miss out any results with a price of 10000 and any of 75000. That is why you would use the greater than or equal to operators. <= and >= Quote Link to comment https://forums.phpfreaks.com/topic/53759-solved-multiple-search-queries/#findComment-265752 Share on other sites More sharing options...
iceblox Posted May 31, 2007 Author Share Posted May 31, 2007 Thanks pocobueno1388, Its the first time i have used those operators, thanks for the advice. Quote Link to comment https://forums.phpfreaks.com/topic/53759-solved-multiple-search-queries/#findComment-265783 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.