Forum Moderators: coopster
$NewQuery = “SELECT * FROM SearchTable WHERE ”
Then Add their search:
$UserQuery = “1 = 1”;
If(!empty($_Post[‘colour’])){ /* repeat this for each Postable item */
$UserQuery.= “ AND colour = “.stripslashes($_Post[‘colour’]);
}
After all their search criteria:
$NewQuery .= $UserQuery;
Then save their $UserQuery to a $_Session var and allow them to save it if they want.
And of course finish with the standard:
$NewQuery .= “LIMIT “.$Page.”, “.$PerPage.” “;
$NewQueryresult = mysql_query($NewQuery, $connect) or die ("query 1: " . mysql_error());
I hope this is understandable!
If someone has a different approach I’d really like some input.
Thanks
I don't know if there's a mechanism that will automagically handle *persistent* cookies, so you may have to code the cookie handling yourself with setcookie() and $_COOKIE[].