Guys,
I'm using the following code which I picked up here to create a dynamic SQL query:
$sql = "SELECT * FROM employees WHERE Status = 'Live' ";
while(list($key, $val) = each($HTTP_GET_VARS)) {
$key = stripslashes($key);
$val = stripslashes($val);
// print "$key / $val<br>";
if ($val != "") {
$sql .= "AND $key LIKE '%$val%' ";
}
}
$query_rsSearch = $sql;
I have to use the GET method and the first page of results is fine, but I'm using navigation links which send another GET variable in the URL which messes the query up (column not found in table).
So... question is, is there a simple way to tell the script to leave a variable out of the query. e.g. a variable called pageNum? Rather than having to define all the potential variables instead?
Hope his makes sense to someone!?