php翻页
2020-12-13 05:17
标签:c int a get 数据 set $conn = mysql_connect("localhost","root","") or
die("连接数据库失败!"); $page = ""; $r = "select * from tiezi where pid = 0"; 上一页 php翻页,搜素材,soscw.com php翻页 标签:c int a get 数据 set 原文地址:http://www.cnblogs.com/pulang/p/3735396.html
mysql_select_db("test");
mysql_query("set names
‘utf8‘");
if(@$_GET[‘page‘]){
$page =
$_GET[‘page‘];
}else{
$page = 1;
}
$pageSize = 2;
//$sum =
($page-1)*$pageSize;
$parentid = 0;
$sum = ($page-1)*$pageSize;
$sql =
"select * from tiezi where pid = 0 limit $sum,$pageSize";
$r =
mysql_query($sql);
$count = count($r);
?>
$totalPage =
$count % $pageSize == 0 ? intval($count / $pageSize) : intval($count /
$pageSize) + 1;
for($i=1;$i
?>
}
?>
下一页