Home > Backend Development > PHP Tutorial > php分页输出有关问题

php分页输出有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:24:50
Original
801 people have browsed it

php分页输出问题

Copy after login






这里是 search.php页的
*****************************
这里是searchshow.php 页的
?>

include("conn/conn.php");
  include("search.php");

  $search=$_POST[search];
$xuanze=$_POST[xuanze];
if($_POST[search]==""){
$search=$_GET[search];
$xuanze=$_GET[xuanze];
}

if(shoptype=="$xuanze"){
$sql1=mysql_query("select count(*) as total from tb_members where shoptype='$search' order by mid");
}elseif(user=="$xuanze"){
$sql1=mysql_query("select count(*) as total from tb_members where user='$search' order by mid");
}elseif(shopname=="$xuanze"){
$sql1=mysql_query("select count(*) as total from tb_members where shopname='$search' order by mid");
}



$minfo=mysql_fetch_array($sql1);//在这里出错
$total=$minfo[total];
$pagesize=5;
if($total    $pagecount=1;

if(($total%$pagesize)!=0){
    $pagecount=intval($total/$pagesize)+1;
}else{
    $pagecount=$total/$pagesize;
}
if(($_GET[page])==""){
    $page=1;
}else{
  $page=intval($_GET[page]);
}


if(shoptype=="$xuanze"){
$sql=mysql_query("select * from tb_members where shoptype='$search' order by mid limit ".($page-1)*$pagesize.",$pagesize");
}elseif(user=="$xuanze"){
$sql=mysql_query("select * from tb_members where user='$search' order by mid limit ".($page-1)*$pagesize.",$pagesize");
}
elseif(shopname=="$xuanze"){
$sql=mysql_query("select * from tb_members where shopname='$search' order by mid limit ".($page-1)*$pagesize.",$pagesize");
}



$info=mysql_fetch_array($sql);//在这里也出错
?>
  
   
    
    
    
    
    
    
  
   if($info){
do{ ?>

    
    
    
帐号 联系人 店铺名称 类型 联系电话 联系地址
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template