<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>";
}
}
?>