<?php
include('connect.php');

error_reporting(0);

if(isset($_POST["rmid"]) && !empty($_POST["rmid"])){
    //Get all state data
    if($_POST["rmid"]=='all'){
	$eve="SELECT * FROM res_college_master";
	}
	else{
	$eve="SELECT * FROM res_college_master WHERE countrymid=".$_POST["rmid"];
	}
    $re = mysqli_query($conn, $eve);
	//echo '<option value="0">'.$eve.'</option>';
    //Count total number of rows
    if(mysqli_num_rows($re) > 0)
	{
		echo '<option value="0">Select College</option>';
        while($rt = mysqli_fetch_assoc($re)){ 
            echo '<option value="'.$rt['collegemid'].'">'.$rt['cmname'].'</option>';
			
        }
    }else{
        echo '<option value="0">No Data Found1</option>'; 
    }
}
?>