The form page is pretty basic...just a category and province listbox that people can choose from...no php involved, just using "GET" to forward the info on to the search results page. The php on the search results page runs like this:
<?php
$maxRows_rsSearchResults = 10;
$pageNum_rsSearchResults = 0;
if (isset($HTTP_GET_VARS['pageNum_rsSearchResults'])) {
$pageNum_rsSearchResults = $HTTP_GET_VARS['pageNum_rsSearchResults'];
}
$startRow_rsSearchResults = $pageNum_rsSearchResults * $maxRows_rsSearchResults;
$varProvince_rsSearchResults = "1";
if (isset($HTTP_GET_VARS['province'])) {
$varProvince_rsSearchResults = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['province'] : addslashes($HTTP_GET_VARS['province']);
}
$varCategory_rsSearchResults = "1";
if (isset($HTTP_GET_VARS['category'])) {
$varCategory_rsSearchResults = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['category'] : addslashes($HTTP_GET_VARS['category']);
}
mysql_select_db($database_connJobFerret, $connJobFerret);
$query_rsSearchResults = sprintf("SELECT jobs.job_title, jobs.province, jobs.city, jobs.posting_date, employers.employer_name FROM jobs, employers, job_categories WHERE employers.employer_id = jobs.employer_id AND jobs.job_id = job_categories.job_id AND jobs.province = '%s' AND job_categories.category_id = '%s' ORDER BY jobs.posting_date DESC", $varProvince_rsSearchResults,$varCategory_rsSearchResults);
$query_limit_rsSearchResults = sprintf("%s LIMIT %d, %d", $query_rsSearchResults, $startRow_rsSearchResults, $maxRows_rsSearchResults);
$rsSearchResults = mysql_query($query_limit_rsSearchResults, $connJobFerret) or die(mysql_error());
$row_rsSearchResults = mysql_fetch_assoc($rsSearchResults);
if (isset($HTTP_GET_VARS['totalRows_rsSearchResults'])) {
$totalRows_rsSearchResults = $HTTP_GET_VARS['totalRows_rsSearchResults'];
} else {
$all_rsSearchResults = mysql_query($query_rsSearchResults);
$totalRows_rsSearchResults = mysql_num_rows($all_rsSearchResults);
}
$totalPages_rsSearchResults = ceil($totalRows_rsSearchResults/$maxRows_rsSearchResults)-1;
?>
Most of it was genertated by Dreamweaver, but it does work fine with single selections from the listboxes on the previous page...just not with multiple selections. Please let me know if you need anything else...I'm just on my way to work, so this was a rushed response. Thanks in advance.