标签:
//1.计算总记录数 $sql_0 = "select * from t_user"; $result_0 = mysql_query($sql_0); $count = mysql_num_rows($result_0); //每页显示多少条 $pageSize = 2; //计算总页数 $totalPage = ceil($count/$pageSize); //确定当前页 if(isset($_GET["page"])) { $page = $_GET["page"]; //限定最大页码 if($page>$totalPage) { $page = $totalPage; } if($page==0) { $page = 1; } } else { $page = 1; } //计算起始位置 $start = ($page-1)*$pageSize;
标签:
原文地址:http://www.cnblogs.com/phpweige/p/4817799.html