<?php
$arr= array();
$parent_id= $_POST['parent_id'];
$super_id= $_POST['super_id'];
include("connect_db.php");
$sql_fetch_zill= "SELECT * FROM area_masters WHERE super_id='$super_id' and parent_id='$parent_id' and status='active'";
$res= mysqli_query($con,$sql_fetch_zill);
if($res){
    if(mysqli_num_rows($res)>0){
        $data['status']= "success";
        array_push($arr,$data);
        while($rows= mysqli_fetch_row($res)){
            $data['id']=$rows[0];
            $data['area_name']=$rows[1];
            $data['super_id']=$rows[2];
            $data['parent_id']=$rows[3];
            $data['status']=$rows[4];
            $data['created_at']=$rows[5];
            $data['updated_at']=$rows[6];
            array_push($arr,$data);
        }
    }
    else{
        $data['status']="fail";
        $data['message']="No data found";
        array_push($arr,$data);
    }
}
else{
    $data['status']="fail";
    $data['message']=mysqli_error($con);
    array_push($arr,$data);
}
echo json_encode($arr);
?>