$sql ="Select * from candi_master a ,candi_detail b where a.reg_id = b.reg_id";
if ($state!="Any"){
$sql.="and a.state=\"$state\"";
} else{
$sql.=",";
}
if ($city!="Any") {
$sql.="and a.city=\"$city\"";
} else{
$sql.=",";
}
if ($marry!="Any") {
$sql.="and a.mar_status=\"$marry\"";
} else{
$sql.=",";
}
if ($qual1!="Any") {
$sql.="and a.quali1=\"$qual1\"";
} else{
$sql.=",";
}
if ($jobfield!="Any") {
$sql.="and b.jobdesc=\"$jobfield\"";
} else{
$sql.=",";
}
if ($exp_mn1!="Any") {
$sql.="and b.jobexp between \"$exp_mn1\" and \"$exp_mn\"";
} else{
$sql.=",";
}
if ($prefdesgn!="Any") {
$sql.="and b.prefdesgn=\"$prefdesig\"";
} else{
$sql.=",";
}
if ($prefcity!="Any") {
$sql.="and b.prefcity =\"$state2\"";
} else{
$sql.=",";
}
if ($prefcountry!="Any") {
$sql.="and b.prefcountry=\"$l_country\"";
} else{
$sql.=",";
}
if ($salary1!="Any") {
$sql.="and b.expsal between \"$salary1\" and \"$salary2\"";
} else{
$sql.=",";
}
if ($p!="Any") {
$sql.="and b.personality=\"$p\"";
} else{
$sql.=",";
}
if ($cs!="Any") {
$sql.="and b.commskill=\"$cs\"";
} else{
$sql.=",";
}
if ($ips!="Any") {
$sql.="and b.depthknow=\"$ips\"";
} else{
$sql.=",";
}
if ($oa!="Any") {
$sql.="and b.overall=\"$oa\"";
} else{
$sql.=",";
}
if ($iq!="Any") {
$sql.="and b.other1=\"$iq\"";
} else{
$sql.=",";
}
if ($eq!="Any") {
$sql.="and b.other2=\"$eq\"";
} else{
$sql.=",";
}
if ($sq!="Any") {
$sql.="and b.other3=\"$sq\"";
} else{
$sql.=",";
}
if ($lq!="Any") {
$sql.="and b.extra=\"$lq\"";
} else{
$sql.=",";
}
if ($state!="Any"){
$sql.="and a.state=\"$state\"";
} else{
$sql.=",";
}
if ($city!="Any") {
$sql.="and a.city=\"$city\"";
} else{
$sql.=",";
}
if ($marry!="Any") {
$sql.="and a.mar_status=\"$marry\"";
} else{
$sql.=",";
}
if ($qual1!="Any") {
$sql.="and a.quali1=\"$qual1\"";
} else{
$sql.=",";
}
if ($jobfield!="Any") {
$sql.="and b.jobdesc=\"$jobfield\"";
} else{
$sql.=",";
}
if ($exp_mn1!="Any") {
$sql.="and b.jobexp between \"$exp_mn1\" and \"$exp_mn\"";
} else{
$sql.=",";
}
if ($prefdesgn!="Any") {
$sql.="and b.prefdesgn=\"$prefdesig\"";
} else{
$sql.=",";
}
if ($prefcity!="Any") {
$sql.="and b.prefcity =\"$state2\"";
} else{
$sql.=",";
}
if ($prefcountry!="Any") {
$sql.="and b.prefcountry=\"$l_country\"";
} else{
$sql.=",";
}
if ($salary1!="Any") {
$sql.="and b.expsal between \"$salary1\" and \"$salary2\"";
} else{
$sql.=",";
}
if ($p!="Any") {
$sql.="and b.personality=\"$p\"";
} else{
$sql.=",";
}
if ($cs!="Any") {
$sql.="and b.commskill=\"$cs\"";
} else{
$sql.=",";
}
if ($ips!="Any") {
$sql.="and b.depthknow=\"$ips\"";
} else{
$sql.=",";
}
if ($oa!="Any") {
$sql.="and b.overall=\"$oa\"";
} else{
$sql.=",";
}
if ($iq!="Any") {
$sql.="and b.other1=\"$iq\"";
} else{
$sql.=",";
}
if ($eq!="Any") {
$sql.="and b.other2=\"$eq\"";
} else{
$sql.=",";
}
if ($sq!="Any") {
$sql.="and b.other3=\"$sq\"";
} else{
$sql.=",";
}
if ($lq!="Any") {
$sql.="and b.extra=\"$lq\"";
} else{
$sql.=",";
}