热门资源

php分页程序及简单实例说明

$sql=select * from my_sbf123手机版,note where
note_url=’4′;$result=mysql_query($sql) or
die(‘Error’.mysql_error());$allrecord=mysql_num_rows($result);$page=isset($_GET[‘page’])?$_GET[‘page’]:1;$pagesize=10;$pagecount=($allrecord
% $pagesize)?(int)($allrecord / $pagesize) +1:$allrecord /
$pagesize;$page=($page$pagecount ||
$page1)?$page=1:$page;$start=$pagesize*($page-1);$sqllist=select *
from my_note where note_url=’4′ order by id desc limit
$start,$pagesize ;$resulte=mysql_query($sqllist) or die(‘Error
‘.mysql_error());$num=mysql_num_rows($resulte);if($num){while($rs=mysql_fetch_object($resulte)){if($rs-note_url==’1′){echo(liimg
src=’pic/point.jpg’ / a href=’.$rs-note_content.’ class=note
target=’_blank’.$rs-note_title./a [.$rs-note_date.] img
src=’pic/new.gif’ //lin);}else{echo(liimg src=’pic/point.jpg’ / a
href=’show.php?id=.$rs-id.’ class=note
target=’_blank’.$rs-note_title./a [.$rs-note_date.]/lin);}}echo(div
id=’page’div class=li 共.$pagecount.页 每页.$pagesize.条记录
共.$allrecord.个作品/div);for($i=$pagecount;$i=1;$i–){echo(div
class=lia href=?page=.$i..($i)./a/div);}echo(/div);}else{echo(‘No
Infomation’);}}

发表评论

电子邮件地址不会被公开。 必填项已用*标注

相关文章