<?php


/*
if($_POST['country_id']){
$id=$_POST['country_id'];
if($id==0){
	echo "<option>Select City</option>";
}else{
   $sqly = "SELECT * FROM tbl_cities WHERE country =$id"; 


   $result = $mysqli_query($con,$sqly);
 
   while($row = mysqli_fetch_array($result)){
	 
        echo '<option value="'.$row['id'].'">'.$row['city'].'</option>';
   }
}
}
*/
?>
<?php
  define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'menahotel');
define('DB_PASSWORD', 'GN%3{3HX1yie');
define('DB_DATABASE', 'menahotel');
$con=mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
if(!empty($_POST["state_id"])) 
{
$query =mysqli_query($con,"SELECT * FROM tbl_cities WHERE country = '" . $_POST["state_id"] . "'");
?>
<option value="">Select City</option>
<?php
while($row=mysqli_fetch_array($query))  
{
?>
<option value="<?php echo $row["id"]; ?>"><?php echo $row["city"]; ?></option>
<?php
}
}
?>
