<?php

require_once "../db.php";

session_start();



$admin_2 = $_POST["admin_2"];

$category_id = $_POST["category_id"];

$result = mysqli_query($con,"SELECT * FROM subject WHERE uploadedby = '$admin_2' AND sc_class_id ='$category_id'");

?>

<option value="">Select Subject...</option>

<?php

if (mysqli_num_rows($result) > 0) {

		

		while($row = mysqli_fetch_array($result)) {

		?>

		<option value="<?php echo $row["sc_id"];?>"><?php echo $row["sc_name"];?></option>

		<?php

		}





}else{

	?>

	<option value="" style="color:red;">Subject Not Found Under This Class</option>

	<?php

}



?>