php实现分页效果的示例-PHP教程( 六 )

$r);
mysqli_close($coon,"jereh");
return $obj->num;
}
@$allNum = allNews();
@$pageSize = 3; //约定没页显示几条信息
@$pageNum = empty($_GET["pageNum"])?1:$_GET["pageNum"];
@$endPage = ceil($allNum/$pageSize); //总页数
@$array = news($pageNum,$pageSize);
?>
</head>
<body>
<table border="1" style="text-align: center" cellpadding="0">
<tr>
<td>编号</td>
<td>新闻标题</td>
<td>来源</td>
<td>点击率</td>
<td>发布日期</td>
</tr>
<?php
foreach($array as $key=>$values){
echo "<tr>";
echo "<td>{$values->id}</td>";
echo "<td>{$values->title}</td>"

经验总结扩展阅读