$connect = mysql_pconnect("localhost","root","hcedagb");
mysql_select_db("icbcoa",$connect);
//基本参数已经设置完成了,现在从数据库中取出总记录数
$sql = "select count(*) as total from oa_rizhi where ((riqi>'".$mdate."') and (username='".$_SESSION["susername"]."'))"; //统计记录总数
$res = mysql_fetch_array(mysql_query($sql));
$countAll = $res['total'];
$sql = "select * from oa_rizhi where ((riqi>'".$mdate."') and (username='".$_SESSION["susername"]."')) order by riqi desc limit $limitFrom,$pagelist";
mysql_query("SET NAMES 'GBK'");
$result = mysql_query($sql);
//$data=mysql_fetch_array($result);
$rows = @mysql_num_rows($result);
while($data=mysql_fetch_assoc($result))
{
$riqi=$data['riqi'];
$neirong=$data['neirong'];
$sneirong = substr($neirong, 0,100);
$bianhao=$data['bianhao'];
//echo $bianhao;
//具体数量查询
if ($forward == 0){
$user_count_sql = "select top 20 gas_ip,sum(user_counts) as counts from t_game_gas with(nolock) group by gas_ip order by gas_ip";
}else if ($forward == 1){
$user_count_sql = "select top 20 gas_ip,sum(user_counts) as counts from t_game_gas with(nolock) where gas_id>$gas_ip group by gas_ip order by gas_ip";
}else if ($forward == 2){
$user_count_sql = "select * from ( select top 20 gas_ip,sum(user_counts) as counts from t_game_gas with(nolock) where gas_id<$gas_ip group by gas_ip order by gas_ip ) t order by t.gas_ip";
}else {
$user_count_sql = "select * from ( select top 20 gas_ip,sum(user_counts) as counts from t_game_gas with(nolock) group by gas_ip order by gas_ip ) t order by t.gas_ip";
}