<?
$ Db = mysql_connect () or die ("unable to connect to MySQL ");
Mysql_select_db ("") or die ("unable to Open Database ");
If (! Isset ($ page ))
$ Page = 1; // if no page parameter is set, page is automatically set to 1.
$ Pageno = 5; // set the number of entries displayed on each page
$ Pagestart = ($ page-1) * $ pageno;
$ SQL = "select * from book order by ID DESC limit $ pagestart, $ pageno ";
$ Result = mysql_query ($ SQL _string );
$ Numrows = mysql_num_rows ($ result );
?>
/*************************************** ********************************
Display content
**************************************** *******************************/
<? // Display data by PAGE
$ Up = $ page-1;
$ DN = $ page + 1;
If ($ page> 1)
{
Print "<center> <br> <a href = $ php_self? Page = $ up> previous page </a> ";
}
Else
{
Echo "<center> <br> previous page ";
}
If ($ pageno> $ numrows)
{
Print "next page ";
}
Else
{
Print "<a href = $ php_self? Page = $ DN> next page </a> | n ";
}
Mysql_close ($ dB );
?>