php中的实用分页类
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <table width= "100%" border= "1" cellpadding= "0" cellspacing= "0" >
<tr>
<td>地区代号</td>
<td>地区名称</td>
<td>父级代号</td>
</tr>
<?php
include ( "LZY.class.php" );
$db = new LZY();
include ( "page.class.php" );
$sz = "select count(*) from chinastates" ;
$az = $db ->Query( $sz );
$page = new Page( $az [0][0],10);
$sql = "select * from chinastates " . $page ->limit;
$arr = $db ->Query( $sql );
foreach ( $arr as $v )
{
echo "<tr>
<td>{ $v [0]}</td>
<td>{ $v [1]}</td>
<td>{ $v [2]}</td>
</tr>";
}
?>
</table>
<?php
echo $page ->fpage();
?>
</body>
|
Salin selepas log masuk
Atas ialah kandungan terperinci 如何通过php实现实用的分页类. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!