BElow is my php code for candidate search, it have 4 criteria which is academic background, functional experience, preferred location and languages ability. but it show yhe blanks page..
Emm, is it becase of the languages ability is at checkbox, so cannot display the profile...
Can someone give me a guildeline... Thanks..
[PHP]<?php
//required file for database connection
include("config .php");
if (isset($_POST['aBackground'])) {
$aBackground = mysql_real_esca pe_string($_POS T["aBackgroun d"]);
$fExperience = mysql_real_esca pe_string($_POS T["fExperienc e"]);
$pLocation = $_POST["pLocation"];
$lAbility = $_POST["lAbility"];
$sql = "SELECT * FROM resume";
$string1 = array();
$where1 = "";
if (isset($_POST["aBackgroun d"]) AND !empty($_POST["aBackgroun d"]))
$string1[] = " aBackground LIKE '%".$_POST["aBackgroun d"]."%' ";
if (isset($_POST["fExperienc e"]) AND !empty($_POST["fExperienc e"]))
$string1[] = " fExperience LIKE '%".$_POST["fExperienc e"]."%' ";
if (isset($_POST["pLocation"]) AND !empty($_POST["pLocation"]))
$string1[] = " pLocation LIKE '%".$_POST["pLocation"]."%' ";
if (isset($_POST["lAbility"]) AND !empty($_POST["lAbility"]))
$string1[] = " lAbility LIKE '%".$_POST["lAbility"]."%' ";
if (!empty($string 1))
$where1 = " WHERE ".implode("AND" , $string1);// OR/AND
$sql1="SELECT * FROM resume $where1";
$string2 = array();
$where2 = "";
if (isset($_POST["aBackgroun d"]) AND !empty($_POST["aBackgroun d"]))
$string2[] = " aBackground LIKE '%".$_POST["aBackgroun d"]."%' ";
if (isset($_POST["fExperienc e"]) AND !empty($_POST["fExperienc e"]))
$string2[] = " fExperience LIKE '%".$_POST["fExperienc e"]."%' ";
if (isset($_POST["pLocation"]) AND !empty($_POST["pLocation"]))
$string2[] = " pLocation LIKE '%".$_POST["pLocation"]."%' ";
if (!empty($string 2))
$where2 = " WHERE ".implode("AND" , $string2);// OR/AND
$sql2="SELECT * FROM resume $where2";
$string3 = array();
$where3 = "";
if (isset($_POST["aBackgroun d"]) AND !empty($_POST["aBackgroun d"]))
$string3[] = " aBackground LIKE '%".$_POST["aBackgroun d"]."%' ";
if (isset($_POST["fExperienc e"]) AND !empty($_POST["fExperienc e"]))
$string3[] = " fExperience LIKE '%".$_POST["fExperienc e"]."%' ";
if (isset($_POST["lAbility"]) AND !empty($_POST["lAbility"]))
$string3[] = " lAbility LIKE '%".$_POST["lAbility"]."%' ";
if (!empty($string 3))
$where3 = " WHERE ".implode("AND" , $string3);// OR/AND
$sql3="SELECT * FROM resume $where3";
$string4 = array();
$where4 = "";
if (isset($_POST["aBackgroun d"]) AND !empty($_POST["aBackgroun d"]))
$string4[] = " aBackground LIKE '%".$_POST["aBackgroun d"]."%' ";
if (isset($_POST["pLocation"]) AND !empty($_POST["pLocation"]))
$string4[] = " pLocation LIKE '%".$_POST["pLocation"]."%' ";
if (isset($_POST["lAbility"]) AND !empty($_POST["lAbility"]))
$string4[] = " lAbility LIKE '%".$_POST["lAbility"]."%' ";
if (!empty($string 4))
$where4 = " WHERE ".implode("AND" , $string4);// OR/AND
$sql4="SELECT * FROM resume $where4";
$string5 = array();
$where5 = "";
if (isset($_POST["fExperienc e"]) AND !empty($_POST["fExperienc e"]))
$string5[] = " fExperience LIKE '%".$_POST["fExperienc e"]."%' ";
if (isset($_POST["pLocation"]) AND !empty($_POST["pLocation"]))
$string5[] = " pLocation LIKE '%".$_POST["pLocation"]."%' ";
if (isset($_POST["lAbility"]) AND !empty($_POST["lAbility"]))
$string5[] = " lAbility LIKE '%".$_POST["lAbility"]."%' ";
if (!empty($string 5))
$where5 = " WHERE ".implode("AND" , $string5);// OR/AND
$sql5="SELECT * FROM resume $where5";
// Call for this $sql
if ($aBackground== ""&&$fExperienc e==""&&$pLocati on==""&&$lAbili ty=""){
$data = mysql_query($sq l)
or die("Cannot execute query");
}
elseif(!empty($ aBackground)&&! empty($fExperie nce)&&!empty($p Location)&&!emp ty($lAbility)){
$data = mysql_query($sq l1)
or die("Cannot execute query");
}
elseif(!empty($ aBackground)&&! empty($fExperie nce)&&!empty($p Location)){
$data = mysql_query($sq l2)
or die("Cannot execute query");
}
elseif(!empty($ aBackground)&&! empty($fExperie nce)&&!empty($l Ability)){
$data = mysql_query($sq l3)
or die("Cannot execute query");
}
elseif(!empty($ aBackground)&&! empty($pLocatio n)&&!empty($lAb ility)){
$data = mysql_query($sq l4)
or die("Cannot execute query");
}
elseif(!empty($ fExperience)&&! empty($pLocatio n)&&!empty($lAb ility)){
$data = mysql_query($sq l5)
or die("Cannot execute query");
}
?>
<?php
$anymatches = mysql_num_rows( $data);
if ($anymatches == 0){
$message="  ; <img src='image/sorry.gif'>".
"<font face='Verdana' size='2'> Sorry, your search returned 0 results.<br>";
include("candid ateSearch.php") ;
exit();
}
?>
<?php
$bgcolor="#cccc ff";
?>
<p align=center><c enter><font face='Verdana' size='3'><stron g>Search Results</strong></p>
<table border='1'align =center>
<TABLE width=100% height="43" align=center cellpadding=0 cellspacing=0> <tr>
<td bgcolor='9999ff ' > <font face='Verdana' color='#000000' size='3'>Resume ID</font></td>
<td bgcolor='9999ff ' > <font face='Verdana' color='#000000' size='3'>Academ ic Background</font></td>
<td bgcolor='9999ff ' > <font face='Verdana' color='#000000' size='3'>Functi onal Experience</font></td>
<td bgcolor='9999ff ' > <font face='Verdana' color='#000000' size='3'>Prefer red Location</font></td>
<td bgcolor='9999ff ' > <font face='Verdana' color='#000000' size='3'>Langua ges Ability</font></td></tr>
</tr>
<?php
$counter = 0;
while($result = mysql_fetch_arr ay( $data )){
if ($counter == 3) {
$counter = 0;
}
if($bgcolor=='# ccccff'){$bgcol or='#ffffff';}
else{$bgcolor=' #ccccff';}
echo"
<tr><td align=left bgcolor=$bgcolo r><a href='candidate Search_result.p hp?id={$result['resume_ID']}'> <font face='Verdana' size='2'>{$resu lt['resume_ID']}</a></td>
<td align=left bgcolor=$bgcolo r> <font face='Verdana' size='2'>{$resu lt['aBackground']}</td>
<td align=left bgcolor=$bgcolo r> <font face='Verdana' size='2'>{$resu lt['fExperience']}</td>
<td align=left bgcolor=$bgcolo r> <font face='Verdana' size='2'>{$resu lt['pLocation']}</td>
<td align=left bgcolor=$bgcolo r> & nbsp; <fon t face='Verdana' size='2'>{$resu lt['lAbility']}</td>
</tr>";
$counter = $counter + 1;
}
?>
</table>
<br><br><br>< a href='candidate Search.php? '><font face='Verdana' size='2'>Search again!!</a>
<?
}
?>[/PHP]