<?php include_once("../includes/main.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 = mysql_query("Select tc.country_name,tf.parent,tf.child,tf.child_name from tbl_country tc
join tbl_faq tf ON tf.child=tc.country_id where tc.parent_childs='".$postdata."'");
    
    $rowCount = mysql_num_rows($query);
    if($rowCount > 0){
     
        while($row = mysql_fetch_array($query)){ 
        echo '<option value="'.$row['child'].'"-"'.$row['child_name'].'">'.$row['country_name'].'</option>';
        }
    }else{
        echo '<option value=""> Services not available</option>';
    }
}
?>