Mmhh, it seems that you are building your sql statement up from a $_POST variable that no longer exists.
/*Chek out this*/
if($_POST['skills'] != '')
{
$aFrom[] = 'resume';
}
if($_POST['firstname'] || $_POST['lastname'] || $_POST['city'] || $_POST['state'] != '')
{
if($_POST['skills'] != '')
{
$aFrom[] = 'INNER JOIN candidate';
}
else
{
$aFrom[] = 'candidate';
}
}
/*######*/
as you sure know, $_POST contins all the variables sent by the client using the POST method, in most cases an HTML form, but when you reload your page (using the links provided), those vars don't get sent again. You have to make sure those values don't dissapear, otherwise your script will not work as you wish.
One solution for this is using session variables.
You could assing the $_POST to a session array the first time you load the page and check out if that session var exists every time the page is loaded, something like
if(!isset($SESSION["somename"]) && isset($POST)) $SESSION["somename"] = $POST;
and use $SESSION instead of $POST in the building of your sql statement.
.....
.....