zoukankan      html  css  js  c++  java
  • php 分页

    public function rangeIndex(){
    	    $start= explode(".",$_GET['startIp']);
    		$startIp=$start[count($start)-1];
    		
    		$stop= explode(".",$_GET['stopIp']);
    		$stopIp=$stop[count($stop)-1];
    		
    		$range= explode(".",$_GET['stopIp']);
    		$rangIp=$range[count($stop)-2];
    		import('ORG.Util.Page');//导入分页类
    		//$m=M("Machine_info");
    		$m=M();
    		//$where[substring_index("ip",'.',-1)] = array(array('gt',$startIp),array('lt',$stopIp));
    		$countNum = $m->query("select count(*) from machine_info where substring_index(ip,'.',-1)>$startIp  and substring_index(ip,'.',-1)<$stopIp and  substring_index(substring_index(ip,'.',-2),'.',1) =$rangIp");
    		//$count = $m->where($where)->select();
    		
    		$count = (int)$countNum[0]["count(*)"];
    		$page=new Page($count,15);//实例化分页类 传入总记录数和每页显示的记录数
    		$show=$page->show();//分页显示输出
    		
    		
    		$result=$m->query("select * from machine_info  where substring_index(ip,'.',-1)>$startIp  and substring_index(ip,'.',-1)<$stopIp and  substring_index(substring_index(ip,'.',-2),'.',1) =$rangIp limit ".$page->firstRow.",".$page->listRows);
    		//$result = $m->where($where)->limit($page->firstRow.','.$page->listRows)->select();
    		$this->assign('result',$result);
    		$this->assign('show',$show);
    		$this->assign('startIp',$_GET['startIp']);
    		$this->assign('stopIp',$_GET['stopIp']);
    		$this->display();
    	}

  • 相关阅读:
    asp调用存储过程
    ASP生成静态文件
    DataReader
    Html中的table
    比较完整的CSS定义表格样式
    HTML中ul,ol,li,dl,dt,dd标签用法
    Sql Server 分区演练
    AWK
    samba配置
    【openSUSE】软件源和软件搜索 看了之后 受益匪浅
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350111.html
Copyright © 2011-2022 走看看