lolopost Posted July 6, 2006 Share Posted July 6, 2006 Ok so basically I have a car in the script with the price of 30000 dollars. The only problem is with the following query[code]$sqlforviewcat=mysql_query("SELECT * FROM postings WHERE subcatid='$_GET[subcatid]' AND cid='$_GET[cid]' AND opt1>='$_POST[minprice]' AND opt1<='$_POST[maximumprice]' AND opt2>='$_POST[minyear]' AND opt2<='$_POST[maxyear]' ORDER BY id DESC");[/code]If you run a search for 2 for minimum and 4 for maximum it will display the car because it's looking at the 0's as null. Can anyone please help me with this problem? If you would like to see the website where I'm trying this from it is located at http://www.lolopost.com/index.php?act=viewcat&cid=pdx&catid=118&subcatid=180 Quote Link to comment https://forums.phpfreaks.com/topic/13886-i-need-help-with-a-search-query/ Share on other sites More sharing options...
jvrothjr Posted July 6, 2006 Share Posted July 6, 2006 I would use for pricing and check to yes what the field type is....[code]Opt1 between '$_POST[minprice]' and '$_POST[maximumprice]'";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13886-i-need-help-with-a-search-query/#findComment-54076 Share on other sites More sharing options...
lolopost Posted July 6, 2006 Author Share Posted July 6, 2006 do you mean in the mysql table? Quote Link to comment https://forums.phpfreaks.com/topic/13886-i-need-help-with-a-search-query/#findComment-54080 Share on other sites More sharing options...
lolopost Posted July 6, 2006 Author Share Posted July 6, 2006 WOW!!! nevermind a mod can go ahead and close this topic... thank you jvrothjr it was my stupid error to put it as a text field when it was supposed to be an integer field... wow i feel dumb Quote Link to comment https://forums.phpfreaks.com/topic/13886-i-need-help-with-a-search-query/#findComment-54083 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.