<?php 
include("dbcon.php");

$nameid = $_POST['datapost'];

$query = "select * from tbl_city where state_id = $nameid";
 $result = mysqli_query($con,$query);
 echo '<option>Select City</option>';
 while($row = mysqli_fetch_array($result)){?>
	
	 <option value="<?php echo $row['city_id'];?>"><?php echo $row['city'];?></option>
	 <?php
 }

?>