<?php
   function getenginename($id){
        $sql="select * from searchengine where id=".$id;   
		$result=mysql_query($sql);
        $rs=mysql_fetch_array($result);
		return $rs[enginename];
   }
   
   function geturl($id){
        $sql="select * from website where webid=".$id;   
		$result=mysql_query($sql);
        $rs=mysql_fetch_array($result);
		return $rs['weburl'];      
   }

   function getgrade($id){
        $sql="select * from grade where gradeid=".$id;   
		$result=mysql_query($sql);
        $rs=mysql_fetch_array($result);
		return $rs[gradename];      
   }
   
   function getlanguage($id){
	$sql="select language from language where id=$id limit 0,1";   
	$result=mysql_query($sql);
	$language=mysql_result($result,0,'language');
	mysql_free_result($result);
	return $language;
}
   function getdomain($id){
	$sql="select domain from language where id=$id limit 0,1";   
	$result=mysql_query($sql);
	$domain=mysql_result($result,0,'domain');
	mysql_free_result($result);
	return $domain;
}
	function getcompany($id){
	$sql="select company from custom where id=$id limit 0,1";	
	$result=mysql_query($sql);
	$company=mysql_result($result,0,'company');
	mysql_free_result($result);
	return $company;
}


	function getitem($arr,$k,$h){
	if($k==1){
		return $arr[$k][$h];
	}
	if(empty($arr[$k][$h])){
		return getitem($arr,$k-1,$h);
	}else{
		return $arr[$k][$h];
	}
}
?>
