Jump to content


Photo

I need help with a search query


  • Please log in to reply
3 replies to this topic

#1 lolopost

lolopost
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 July 2006 - 07:26 PM

Ok so basically I have a car in the script with the price of 30000 dollars. The only problem is with the following query

$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");

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....18&subcatid=180

#2 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 06 July 2006 - 07:35 PM

I would use for pricing and check to yes what the field type is....

Opt1 between '$_POST[minprice]' and '$_POST[maximumprice]'";

If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#3 lolopost

lolopost
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 July 2006 - 07:38 PM

do you mean in the mysql table?

#4 lolopost

lolopost
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 July 2006 - 07:41 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users