<?php include_once("../includes/cmain.inc.php");?>
<?php
if(isset($_POST["parent_childs"]) && !empty($_POST["parent_childs"])){
	 $postdata = $_POST["parent_childs"];
  // $query = mysql_query("SELECT * FROM `tbl_faq` WHERE `parent` ='".$postdata."'");
  $query = db_query("Select tc.country_name,tf.parent,tf.child from tbl_country tc
join tbl_faq tf ON tf.child=tc.country_id where tc.parent_childs='".$postdata."'");
    
    $rowCount = mysqli_num_rows($query);
    if($rowCount > 0){
     
        while($row = mysqli_fetch_array($query)){ 
        echo '<option value="'.$row['child'].'">'.$row['country_name'].'</option>';
        }
    }else{
        echo '<option value=""> Services not available</option>';
    }
}