<?php 
@session_start();
@ob_start();
$conn = mysql_connect('localhost', 'root', '') or die ("connection not found");
	mysql_select_db('db_hr') or die ("connection not found");
	if(isset($_REQUEST["department"])){
$department=$_REQUEST["department"];


		
  
							$sqls="select * from tbl_designation where dept_id = '$department'";
							
							$sup=mysql_query($sqls);
							
							?>
							<select name="desig" id="desig" class="form-control" required >
							<?php
							
							echo " <option>select</option>";
							while($csup=mysql_fetch_array($sup))
							{?>
							
     <?php  echo "<option value='".$csup['id']."'>".$csup['designation']."</option>"; ?>
	  
      <?php }?>
    </select> 
	
	<?php 
	}	 
?>

                  
               
 