table order by id"> 跳转到主内容
极星编程网:以代码为星,赴技术山海!

php中分页代码解决方案

php中分页代码Information php
dbConnect() ;//$error=new Script() ;$pageSize=2 ;$page_string = "";$totalpage="" ;if( isset($_GET['page']) ){$page = intval( $_GET['page'] );}else{$page = 1;}$sql="select count(*) as amount from $mysql->table order by id desc" ;$result = mysql_query($sql);$amount = mysql_result($result , 0 , "amount");if($amount){if($amount $totalpage = 1;}if( $amount % $pageSize ){$totalpage = intval($amount / $pageSize) + 1;}else{$totalpage = $amount / $pageSize;}}else{$totalpage = 1;}?>娣诲

相关文章