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

$nameid = $_POST['datapost'];

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

?>