Home >php教程 >PHP源码 >php 分页程序代码

php 分页程序代码

WBOY
WBOYOriginal
2016-06-08 17:29:421064browse

php 分页程序代码

<script>ec(2);</script>

    $tempquery = mysql_query("select dpb,facejtype from zgy_member_p_d_basic where  dpb = '$city' and      facejtype like '%$keyword%' ");
  $count = mysql_num_rows( $tempquery );
  if( $count )
  {
   $page=isset($_GET['page'])?$_GET['page']:1;
   $pagesize=20;  
   $pagecount=($count % $pagesize)?(int)($count / $pagesize) +1:$count / $pagesize;  
   $page=($page>$pagecount || $page    $start=$pagesize*($page-1);
     $sql = "Select
     dpb,     
     truename,
     uid,
     sex,
     birth,
     education,
     experience,
     facejkind,
     facejtype,
     id
    from 
     zgy_member_p_d_basic
    where
     dpb = '$city' and
     facejtype like '%$keyword%' group by uid order by id desc limit $start,$pagesize";
     
   $query = mysql_query( $sql ) or die( mysql_error() );  
      
   while( $rs = mysql_fetch_array( $query ) )
   {
   ?>
   


   =$rs['truename']?>
   
   
    $date = date("Y-m-d");
    $date1 = $rs['birth'];    
    echo sdate($date,$date1);
    
   ?>   
   = $rs['sex'] ? '男' : '女' ;?>
   = $rs['education']?>
   = $rs['experience']?>
   = $rs['facejkind']?>
   
        }
    
  ?>
  
       
  
总数:=$count?>/条 每页=$pagesize?>条 当前第=$page?>/=$pagecount?> 首页 上一页 下一页 尾页 转到 第
   
 
 
 
  页
   
 

  

 
 
 
  
  }
  else
  {
   ?>
     
        对不起,您要查找内容暂时不存在!
     
       }
   ?>
   
 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn