<?php
include 'config.php';
$region_arr = array();
$zone_arr = array();

$query=mysqli_query($conn,$conn,"SELECT DISTINCT `region` FROM `auto_tbl` WHERE `status` = 'Qualified' ORDER BY `region` ASC "); 
if(mysqli_num_rows($query) >0){
    while($row = mysqli_fetch_array($query)){
        array_push($region_arr,$row['region']) ;
        
    }
}
$region_arr = '('.'"' . implode('", "', $region_arr) . '"'.')';
print_r($region_arr);
$query=mysqli_query($conn,$conn,"SELECT DISTINCT `zone` FROM `auto_tbl` WHERE `status` = 'Qualified' AND `region` IN $region_arr ORDER BY `zone` ASC "); 
echo "</br>";
echo "SELECT DISTINCT `zone` FROM `auto_tbl` WHERE `status` = 'Qualified' AND `region` IN $region_arr ORDER BY `zone` ASC";
if(mysqli_num_rows($query) >0){
    while($row = mysqli_fetch_array($query)){
        array_push($zone_arr,$row['zone']) ;
    }
}
print_r($zone_arr);
?>