Home > Backend Development > PHP Tutorial > An example of paging in PHP_PHP tutorial

An example of paging in PHP_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 16:06:56
Original
724 people have browsed it

if(!$whichpage)
{  
$notepage=1;
}
else
{
$notepage=$whichpage;
}
$noterecs=0;
$pagesize=10;
$bbsconn=mysql_connect("localhost","root");
mysql_select_db("rainwindy",$bbsconn);
$bbsresult=mysql_query("select * from bbs order by id desc",$bbsconn);
$rsnum=mysql_num_rows($bbsresult);
$pagecount=ceil($rsnum/$pagesize);
mysql_data_seek($bbsresult,($notepage-1)*10);
?>




    
      
      
      
      
      
   
while(($bbsrow=mysql_fetch_array($bbsresult)) && ($noterecs<=9))
{

?>

      
      
      
      
      


$noterecs=$noterecs+1;
}
?>
编号 用户名 发表人 文章标题 发表时间
" target="disp">








$pad=0;
for($counter=1;$counter<=$pagecount;$counter++)
{
if($counter>=10)
{  
$pad="";
}

echo("".$pad.$counter."  ");
}
?> 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315304.htmlTechArticle?php if(!$whichpage) { $notepage=1; } else { $notepage=$whichpage; } $noterecs=0; $pagesize=10; $bbsconn=mysql_connect(localhost,root); mysql_select_db(rainwindy,$bbsconn); $bbsresu...
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template