
江宁网站建设公司创新互联,江宁网站设计制作,有大型网站制作公司丰富经验。已为江宁近1000家提供企业网站建设服务。企业网站搭建\成都外贸网站建设公司要多少钱,请找那个售后服务好的江宁做网站的公司定做!
$conn=MySQL_connect("localhost","root","");
//$result2=mysql_db_query("hello_world", "insert into hello_table values ('add1',8)",$conn);
// $result2=mysql_db_query("hello_world", "delete from hello_table where hello_column='add1'",$conn);
$resultNum=mysql_db_query("hello_world","select count(*) from hello_table order by hello_column",$conn);
$RSS=mysql_fetch_array($resultNum);
$num=$RSS[0];
if(empty($_GET['page'])){
$page=0;
}else{
$page=$_GET['page'];
if($page<0){
$page=0;
}
if($page>=ceil($num/5)){
$page=ceil($num/5)-1;
}
}
$excute="select * from hello_table order by hello_column limit ".($page*5).",5 ";
$result=mysql_db_query("hello_world",$excute ,$conn);
$row=mysql_fetch_row($result);
for($i=0;$i echomysql_field_name($result, $i)." "; } echo" while($row=mysql_fetch_row($result)){ for($i=0;$i echo$row[$i]." "; } echo" } mysql_free_result($result); mysql_close($conn);     ?> < a href="test.php?page=0">FirstPage < a href="test.php?page==($page-1) ?>">PrevPage < a href="test.php?page==($page+1) ?>">NextPage < a href="test.php?page==ceil($num/5)-1 ?>">LastPage  =====================================================================   怎么分段,当前在第几段 (每页有几条,当前再第几页)   前10条记录:select * from table limit 0,10 第11至20条记录:select * from table limit 10,10 第21至30条记录:select * from table limit 20,10       (当前页数 - 1 )X 每页条数 , 每页条数 Select * from table limit ($Page- 1) * $PageSize, $PageSize
";
";
                                                当前题目:PHP分页                                                
                                                标题URL:http://www.scyingshan.cn/article/jgiddg.html
                                            

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 