<?php
include('connection.php');
$department_name=$_GET['dept_name'];
$res1="SELECT * FROM `dept_category` where dept_name='$department_name'";
$result1=mysqli_query($GLOBALS["___mysqli_ston"], $res1) OR DIE ("Query Failed :" . mysqli_error($GLOBALS["___mysqli_ston"]));
	 if(mysqli_num_rows($result1)>0) 
	 					{
	 						 								
while($rw2=mysqli_fetch_assoc($result1))
{
		$depart_id=$rw2['dept_code'];
	
	$res11="SELECT * FROM `dept_sub_category` where dept_code='$depart_id'";

$result11=mysqli_query($GLOBALS["___mysqli_ston"], $res11) OR DIE ("Query Failed :" . mysqli_error($GLOBALS["___mysqli_ston"]));
	   												/*	echo '<option value="">--select--</option>';*/
while($rw22=mysqli_fetch_assoc($result11))
	
	{
				$srno = $rw22['srno'];
				$depart_name = $rw22['dept_sub_category'];
		
     		
						echo '<option value="'.$srno.'">'.$depart_name.'</option>';
			   }
}
}
else{
	
echo 1;	
	
	}
?>