<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
$lianjie = mysql_connect("localhost","root","xiaolie") or die("连接失败");
mysql_query("set names utf8");
if($lianjie)
{
mysql_select_db("xiaolie");
if(!@$_GET["id"])
{
$jieguo = "select * from zhuce";
$fasong = mysql_query($jieguo) or die(mysql_error());
echo "<table border=1>
<tr>
<td>编号</td>
<td>用户名称</td>
<td>性别</td>
<td>年龄</td>
<td>注册时间</td>
<td>详细信息</td>
</tr>";
while($nr=mysql_fetch_array($fasong))
{
echo "<tr>
<td>".$nr["id"]."</td>
<td>".$nr["name"]."</td>
<td>".$nr["xingbie"]."</td>
<td>".$nr["nianling"]."</td>
<td>".$nr["zc_shijian"]."</td>
<td><a href=ck_my.php?id=".$nr["id"].">查看</a></td>
</tr>";
}
echo "</table>";
}
else
{
$jieguo = "select * from zhuce where id=".$_GET["id"];
$fasong = mysql_query($jieguo);
$nr = mysql_fetch_array($fasong);
echo "编号:".$nr["id"]."<br>用户名称:".$nr["name"]."<br>性别:".$nr["xingbie"]."<br>年龄:".$nr["nianling"]."<br>注册时间:".$nr["zc_shijian"]."<br>";
echo "<br><br><a href=ck_my.php>继续查询</a>";
}
}
?>