<?php
   function query($sql){
    $query=mysql_query($sql);
    $row=mysql_fetch_array($query);
	return $row;
   }

    function listquery($sql){
    $query=mysql_query($sql);
	   while($row=mysql_fetch_array($query)){
		
		  $a[]=$row;;
		}	
		return $a;
   }
   
   function gzsql($arr){
	  foreach ($arr as $key=>$v){
	  
			 $s[]=$key; 
			 $x[]=$v;  
			 $col = implode(",", $s);
			 $val = implode("', '", $x);
	  }
	  return  $sql = "($col) values ('$val')";  
    }
	
   function upsql($arr){
	  foreach ($arr as $key=>$v){
	  
			 $sqla = $key."='";
			 $sqlb =$v."',";			 
			 $sql.=$sqla.$sqlb;			
	  }
	  $sql=substr($sql,0,-1);//去掉最后一个逗号
	  return  $sql;  
    }
	
function msg($msg,$url){
  
       if($url){  
        exit("<script>layer.msg('".$msg."', {closeBtn: 0,time:1500},function(){window.location.href='".$url."'});</script>");
	   }else{
	    exit("<script>layer.msg('".$msg."', {closeBtn: 0,time:1500},function(){window.history.go(-1);});</script>");
	   }
  }
	

$onurl= 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];	//获取当前URL 用于操作跳转

$site=query("select * from seo where id=1");
	
function gg($a){
	$ggrow=query("select * from gg where id='$a'");
	echo $ggrow['content'];
}	

?>
