Home >Backend Development >PHP Tutorial >PHP分页,有代码帮看一下.点击分页获取值失效了.大大帮忙

PHP分页,有代码帮看一下.点击分页获取值失效了.大大帮忙

WBOY
WBOYOriginal
2016-06-13 10:11:391155browse

PHP分页求助,有代码帮看一下.点击分页获取值失效了在线等....大大帮忙

$conn=mysql_connect("localhost","root","toma123") or die("连接错误");
mysql_select_db("cs",$conn);
mysql_query("set names 'GBK'");
mysql_query("set characher set gb2312");
mysql_query("set names gb2312");



$tt=$_GET['tt'];



if($Submit){
$sql="select * from ud8 where sessionm = '$tt'";
echo $sql;

$result=mysql_query($sql) or die ("$sql");

$sst=mysql_fetch_array($result);

$num=mysql_num_rows($result); //统计行数

$pages=ceil($num/5); //总页数

$page=$_GET['page']; //获得page,如果没有设置或者page=0,把$page=1;

if($page=="")
{  
$page=1;  
 
}

$start=($page-1)*5;

$sql="select * from ud8 where sessionm like '%$tt%' limit ".$start.",". 5 ;


$query=mysql_query($sql) or die($sql);

?>


while($sumpage=mysql_fetch_array($query))
{
$XX="PHP分页,有代码帮看一下.点击分页获取值失效了.大大帮忙";

$id=$sumpage['id'];  

?>















公司名称
图片缩略图
简介
操作


 


}



if($num!=0)
{
if($page!=1)
{

"首页";
}else 
{
"首页\t";  
}
if($page>1)
{
"上一页\t";
}else
{
"上一页\t";
}  
if($page {
"下一页\t";
}else 
{
"下一页\t";
}  
if($page!=$pages )
{
"尾页\t";


}else 
{
"尾页\t";
}
}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