<?


//$conn = mysql_connect("localhost","root","root");
//mysql_select_db("example",$conn);

include ("config.php");
//mysql_select_db('web19db1');
if(isset($_GET['getCountriesByLetters']) && isset($_GET['letters'])){
	$letters =strtoupper( $_GET['letters']);
	$letters = preg_replace("/[^a-z0-9 ]/si","",$letters);
	$res = mysql_query("select BusNumber,StopName from stop where StopName like '".$letters."%'") or die(mysql_error());
	//$res = mysql_query("select ID,countryName from ajax_countries where countryName like '".$letters."%'") or die(mysql_error());
	#echo "1###select ID,countryName from ajax_countries where countryName like '".$letters."%'|";
	while($inf = mysql_fetch_array($res)){
		echo $inf["BusNumber"]."###".$inf["StopName"]."|";
	}	
	
}
////////////////////////////////////Get Details Form DB During Upate///////////////////////////////////////////////////////////
if(isset($_GET['getDetails']) && isset($_GET['letters'])){
	$letters = $_GET['letters'];
	$letters = preg_replace("/[^a-z0-9 ]/si","",$letters);
	$res = mysql_query("select Name,Gender,TeleNo,Batch,Semester,BusNumber,StopName from student where AdmissionNo like '".$letters."%'") or die(mysql_error());
	//$res = mysql_query("select ID,countryName from ajax_countries where countryName like '".$letters."%'") or die(mysql_error());
	#echo "1###select ID,countryName from ajax_countries where countryName like '".$letters."%'|";
	while($inf = mysql_fetch_array($res)){
		echo $inf["Name"]."###".$inf["Gender"]."###".$inf["TeleNo"]."###".$inf["Batch"]."###".$inf["Semester"]."###".$inf["BusNumber"]."###".$inf["StopName"]."|";
	}	
	
}
?>
