<?php

require_once "../db.php";

session_start();



$category_id = $_POST["category_id"];



$result = mysqli_query($con,"SELECT * FROM users

 WHERE admin_ref = '$_SESSION[uref]' AND sclass ='$category_id'");

?>

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

<?php

if (mysqli_num_rows($result) > 0) {

		

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

		?>

		<option value="<?php echo $row['uphone'];?>"><?php echo $row["uname"];?></option>

		<?php

		}



}else{

	?>

	<option value="" style="color:red;">Student Not Found</option>

	<?php

}



?>