For an example of implementing pagination in PHP, read an example of implementing pagination in PHP ,? Phpif (! $ Whichpage) {$ notepage = 1;} else {$ notepage = $ whichpage;} $ noterecs = 0; $ pagesize = 10; $ bbsconn = mysql_connect (localhost, roo 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 );
?>
No. |
User name |
Publisher |
Article title |
Posting time |
While ($ bbsrow = mysql_fetch_array ($ bbsresult) & ($ noterecs <= 9 )){?>
|
|
|
"Target =" disp "> |
|
$ Noterecs = $ noterecs + 1;}?>
$ Pad = 0;
For ($ counter = 1; $ counter <= $ pagecount; $ counter ++)
{
If ($ counter> = 10)
{
$ Pad = "";
}
Echo ("". $ pad. $ counter ."");
}
?>