<?php 
include($_SERVER["DOCUMENT_ROOT"].'/incs/config.inc.php');
$country_id = $_POST['country_id'];
include(BASE);
$res = $dbc->query("SELECT * FROM `counties` WHERE `country_id`='".$country_id."'");
if($res->num_rows > 0){
echo "<option selected=\"\" disabled=\"\">Select a county</option>"; 
while($r = $res->fetch_array()){
echo "<option value='".$r['cnty_id']."'>".$r['county_name']."</option>";          
 }
 }else{
    echo "<option selected=\"\" disabled=\"\">There are no counties added</option>"; 
 }
?>