$sql = "select PETITION_ID,PETITION_STATUS from gm_petition INNER JOIN gm_applicant ON gm_petition.APPLICANT_ID = gm_applicant.APPLICANT_ID where PETITION_ID LIKE '%".$_POST['search']."%' or APPLICANT_ID LIKE '%".$_POST['search']."%' or EMPLOYEE_ID LIKE '%".$_POST['search']."%' order BY PETITION_ID ASC";
This Query error ==> select PETITION_ID,PETITION_STATUS from gm_petition INNER JOIN gm_applicant ON gm_petition.APPLICANT_ID = gm_applicant.APPLICANT_ID where PETITION_ID LIKE '%2%' or APPLICANT_ID LIKE '%2%' or EMPLOYEE_ID LIKE '%2%' order BY PETITION_ID ASC
$sql = "select PETITION_ID,PETITION_STATUS,APPLICANT_NAME,APPLICANT_LASTNAME,EMPLOYEE_NAME,EMPLOYEE_LASTNAME from gm_petition INNER JOIN gm_applicant ON gm_petition.APPLICANT_ID = gm_applicant.APPLICANT_ID INNER JOIN gm_employee ON gm_petition.EMPLOYEE_ID = gm_employee.EMPLOYEE_ID where gm_petition.PETITION_ID LIKE '%".$_POST['search']."%' or gm_applicant.APPLICANT_NAME LIKE '%".$_POST['search']."%' or gm_employee.EMPLOYEE_NAME LIKE '%".$_POST['search']."%' order BY PETITION_ID ASC";
$sql_loc = "select a.loctype_name , b.* from locationtype a INNER JOIN location b ON a.loctype_id=b.loctype_id ";
if($_POST["keyword"]!="") {
$sql_loc .= " where loc_name like '%".$_POST["keyword"]."%' or loc_address like '%".$_POST["keyword"]."%' or loctype_name like '%".$_POST["keyword"]."%' ORDER BY loc_id ASC";