<?php
	include'../connection.php';
	$stateId = $_GET['stateId'];
	$distId = $_GET['distId'];
	$reDistrict = mysqli_query($con,"SELECT * FROM district WHERE State='$stateId'");
	
	
	echo "<option>--Select District--</option>";
	
	while($dataDistrict=mysqli_fetch_array($reDistrict))
	{	
	    if($distId==$dataDistrict['Name'])
	    {
		    echo "<option selected>".$dataDistrict['Name']."</option>";
	    }
	    else
	    {
	        echo "<option>".$dataDistrict['Name']."</option>";
	    }
	}

?>