Jump to content

Archived

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

lolopost

I need help with a search query

Recommended Posts

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

Share this post


Link to post
Share on other sites
I would use for pricing and check to yes what the field type is....

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

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.