<?php
include "page.class.php";
$link=mysql_connect("localhost","root");
if(!$link){
echo "链接数据库失败!";
exit;
}
mysql_select_db("users",$link);
$result=mysql_query("select * from shops");
$total=mysql_num_rows($result);
$num=8;
$page=new page($total,$num);
$sql="select * from shops{$page->limit}";
$result=mysql_query($sql);
echo *<table align="center", width="800px" border="black">*;
echo*<caption><h1>shops</h1></caption>*;
while($row=mysql_fetch_assoc($result)){
echo *<tr>*;
echo *<td>*.$row[id].*</td>*;
echo *<td>*.$row[name].*</td>*;
echo *<td>*.$row[sex].*</td>*;
echo *</tr>*;
}
echo *<tr><td colspan="5", align="right">*.$page->fpage().*</td><tr>*;
echo "</table>";
?>