分页源代码,分页时上一页下一页不显示,但可以跳转
$sql="select * from product where pronum like'%$key%' or pdes like '%$key%'";
$page=$_REQUEST["page"];
$ss=mysql_query($sql,$conn);
$row1=mysql_fetch_array($ss);
$num=$row1[0];
if($num>0)
{
if (empty($_GET['page']))
{ $page=1;}
else
{$page=$_GET['page'];}
if($page<1)$page=1;
if($page>=ceil($num/5)) $page=ceil($num/5);
$sql1="select * from product where pronum like'%$key%' or pdes like '%$key%' limit ".($page*5).",5";
//echo $sql1;
$rest1=mysql_query($sql1,$conn);
?>
while($row=mysql_fetch_array($rest1))
{ ?>
<?php echo $row["pronum"]?><?php echo $row["pdes"]?>
{?>
firsPage
PrevPage
}
else
{?>
firsPage
PrevPage
} ?>
{ ?> nextPage
LastPage
else
{ ?> nextPage
LastPage
}
else
{echo"";
} ?>
_uacct = "UA-1708392-2";
urchinTracker();