<?php



include 'connect.php';



$state=$_GET['state'];



if($state!='')

{



$state=$_GET['state'];



$sql=mysqli_query($conn,"SELECT * from districts where state='$state'") or die(mysqli_error($conn));



echo'<div><div id="district">



<option value="" selected="selected">-- Select --</option>';



while($result=mysqli_fetch_assoc($sql))

{



echo'<option value="'.$result['ID'].'">'.$result['district'].'</option>';



}



echo'</div></div>';



}







?>