您好,欢迎访问一九零五行业门户网

PHP简单分页的实现

程序的关键点是页码的获取
query($allsql); $field = $rest->fetch_fields(); $fieldnum = count($field); //字段数量 //获取数据量 $rownum = $rest->num_rows; // echo 记录条数:.$rownum; $allpage=ceil($rownum/$every); // echo ----每页分$every.条时有$allpage.页
; // $pagenow=($pagenow-1)*$every; echo ; // echo 测试信息表 添加; // echo $pagenow.页; echo ; for ($i=0; $i name. ; } echo
; //显示分页 $sql=select * from $table limit $start,$every;; // echo $sql; $newrest = $conn->query($sql); while($row = $newrest->fetch_row()){ echo ; for ($j=0; $j
//css文件
*{padding: 0px; margin: 0px;}.center{text-align: left; color: red; text-indent: 500px;}#info{color: dodgerblue;}.table{ margin-left: auto; margin-right: auto; width: auto; text-align: center; color: royalblue; border: 0; }.td{width: 150px; /*text-indent: 10px;*/ text-align: left; font-size: 14px;}#td{color: #555;}tr:hover{background-color: dodgerblue;}.info{text-align: center; color: red;}.link{color: blue; text-decoration: none; text-align: center; font-size: 12px;}.h3{text-align: center; }#divclass{width: 100%; height: 30px; margin-top: 10px; font-size: 18px; /*background: coral;*/ }#center{width: 27%; /*display: inline-block;*/ height: 30px; margin-left: auto; margin-right: auto; /*background: orange;*/ }.fy{ /*background: dodgerblue;*/ height: 30px; line-height: 30px; display: inline-block; float: left; color: dodgerblue; padding-left: 5px; text-decoration: none; text-align: center; }.option{width: 80px; height: 30px; background: white; float: left; border: 2px solid dodgerblue; display: inline-block;}.button{width: 56px; float: left; color: white; background: dodgerblue; height: 30px; border: 0px; border-radius: 0px; display: inline-block;}
其它类似信息

推荐信息