Home  >  Article  >  Backend Development  >  PHP分页赋值有关问题.大大帮助解决一下.了给分附代码

PHP分页赋值有关问题.大大帮助解决一下.了给分附代码

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

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");
$key = $_GET['key'];

?>










 


$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");

$md=$_GET['key'];



if($md!=""){

$sql="select * from ud8 where title like '%$md%'";

$result=mysql_query($sql);

$sst=mysql_fetch_array($result);

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

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

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

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

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

$sql="select * from ud8 where title like '%$md%' limit ".$start.",". 8;

$query=mysql_query($sql);
   
while($sumpage=mysql_fetch_array($query)){
 
$id=$sumpage['id'];

$dd=$id; 



?>
   
 


 
 
 
 
 
 
 
 
 

 
公司名称
业务介绍
图片缩略图
查看名片

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