<?php
session_start();
include('connect.php');
error_reporting(0);

if(isset($_POST["countrymid"]) && !empty($_POST["countrymid"])){
    //Get all state data
	$countrymid=$_POST['countrymid'];
	$_SESSION['selectedcountrymid']=$countrymid;
	$eve="select * from res_college_master,res_contact_master where res_contact_master.clinkid = res_college_master.collegemid and res_contact_master.clinktype = 'College' and res_college_master.countrymid=$countrymid";
//echo '<option value="'.$eve.'">'.$eve.'</option>';
	$re = mysqli_query($conn, $eve);

    //Count total number of rows
    if(mysqli_num_rows($re) > 0)
	{
		echo '<option value="0">Select</option>';
        while($rt = mysqli_fetch_assoc($re))
		{
			$collegemid=$rt['collegemid'];
			/* $_SESSION['selectedcourse']=$cnmid;
			$collegemid=$rt['collegemid']; */
			$cmname=$rt['cmname'];
			
            echo '<option value="'.$collegemid.'" selected>'.$cmname.'</option>';
        }
    }else{
        echo '<option value="0">Select </option>';
    }
}
?>
