<?php
//include "fenyshow.php";
header("content-type:text/html;charset=utf-8");
$page = 1;
$link = mysqli_connect ("localhost","root","","regedit");
if (!$link)
{
die("连接失败!");
}
$sql= "select count(*) as count from form";
$obj= mysqli_query($link,$sql);
$pageall = mysqli_fetch_assoc($obj);
$count = $pageall['count'];
$num = 5;
$pagecount = ceil($count/$num);
$offset = ($page-1)*$num;
//echo "$offset";
$sql="select username,password,qquser from form limit ".($page-1)*$num.",".$num;
$reslut = mysqli_query($link,$sql);
if (mysqli_num_rows($reslut)>0)
{
echo '<table width="60%" border="1" align="center">';
echo '<th>用户名 </th><th>密码</th><th>QQ号</th>';
while ($row = mysqli_fetch_assoc($reslut))
{
echo '<tr>';
echo '<td>'.$row['username'].'</td>';
echo '<td>'.$row['password'].'</td>';
echo '<td>'.$row['qquser'].'</td>';
//echo '<td><a href="del.php?username='.$rows['username'].'">删除</a>/<a href="update.php?username='.$rows['username'].'">更新</a></td>';
echo '</tr>';
}
echo '</table>';
}else {
echo "没有数据!";
}
mysqli_close($link);
?>