Jump to content

Search Function


Recommended Posts

Hello I have a website where I got 4 search options.Its a place to search among game accounts world, level, vocation and price.

$voc = $_REQUEST['voc'];$lvl = $_REQUEST['lvl'];$server = $_REQUEST['server'];$price = $_REQUEST['price'];if(($voc=='Accs') && ($lvl=='Accs') && ($server=='Accs') && ($price=='Accs')) {$result = mysql_query("SELECT * FROM addacc WHERE gransk=1 ORDER BY id desc LIMIT $offset, $rowsperpage");}else{$result = mysql_query("SELECT * FROM addacc WHERE gransk=1 AND voc='$voc' OR voc1='$voc' OR voc2='$voc' OR voc3='$voc' AND lvl<='$lvl+10' OR lvl1<='$lvl+10' OR lvl2<='$lvl+10' OR lvl3<='$lvl+10' AND world='$server' OR world1='$server' OR world2='$server' OR world3='$server' AND price<='$price+20' OR price1<='$price+20' OR price2<='$price+20' OR price3<='$price+20' ORDER BY id desc LIMIT $offset, $rowsperpage");}

My goal is to1. Somehow make it search for example from the value in price to the value +20 because the search option says "10-30".2. Be able to search with not all options filled in, some to stay on "Accs" wich means "All".I dunno if im totally wrong with what I've come up with but I'd love some help =)

Edited by Gatsu
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...