<?php

require_once "../db.php";

session_start();



$category_id = $_POST["category_id"];

$result = mysqli_query($con,"SELECT * FROM subject WHERE uploadedby = '$_SESSION[uref]' 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

}



?>