<?php



include 'connect.php';



if($_GET['department'])



{



$department=$_GET['department'];



$sql=mysqli_query($conn,"SELECT * from employee_designation where department='$department' order by ID asc") or die(mysqli_error($conn));



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

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



while($result=mysqli_fetch_assoc($sql))



{



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



}



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





}



?>