首页
";上一页
";下一页
";尾页
";...
";...
";共" . $this->myde_page_count .
"页" . $this->myde_total . "条数据
?>
include_once("config.php"); ?>
require_once('page.class.php'); //Paging class
$showrow = 3; //Number of rows displayed on one page
$curpage = empty($_GET['page']) ? 1 : $_GET['page']; //The current page should also handle non-numeric situations
$url = "?page={page}"; //Paging Address, if there is a search condition="?page={page}&q=".$_GET['q']
//The code linking mysql is omitted, add it yourself during testing
$sql = "SELECT id,content,lastdate FROM message";
$total = mysql_num_rows(mysql_query($sql)); //Total number of records
if (!empty($_GET['page']) && $total != 0 && $curpage > ceil( $total / $showrow))
$curpage = ceil($total_rows / $showrow); //The current page number is greater than the last page number, take the last page
//Get data
$sql .= " LIMIT " . ($ curpage - 1) * $showrow . ",$showrow;";
$query = mysql_query($sql);
?>
;meta name="keywords" c /> .com/jquery/css/common.css" />
padding:20px 0px;
}
display:block; px;
using use with through ’ through ’ through through using ’ through ’ s ’ through through ’ through ‐ to ‐ ‐‐‐‐‐‐ ‐ ‐ ‐ ‐ ‐ _ _ _ to 1px; -decoration:none;
#page a:hover{
#page p{
float:left; height:24px;
margin-right:8px; style:none;
background:none; }
#page p.pageRemark b{
color:red;
}
#page p.pageEllipsis{
border-style:none;
background:none;
padding:4px 0px;
color:#808080;
}
.dates li {font-size: 14px;margin:20px 0}
.dates li span{float:right}
教程:PHP简单漂亮的分页类
$page = new page($total , $showrow, $curpage, $url, 2); ; div class = "FOOT" & GT;
Powered by Sucaihuo.com This site is the original author, please indicate the original link: & lt; a href = "http://www.sucaihu.com" target = "_ Blank" "" >www.sucaihuo.com
">
$host="localhost";
$db_user="root";
$db_pass=" ";
$db_name="test";
$timez/Shanghai";
$link=mysql_connect($host,$db_user,$db_pass);
mysql_select_db($db_name,$link);mysql_query("SET names UTF8 ");header("Content-Type: text/html; charset=utf-8");
The above has introduced the PHP general paging component, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.