<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)
{
$a = $_GET["id"];
$sc = "delete from zhuce where id=$a";
$fasong = mysql_query($sc) or die(mysql_error());
if($fasong)
echo "記錄已經成功刪除<a href=sc_my.php>繼續刪除記錄</a>";
else
echo "刪除記錄失敗<br><a href=sc_my.php>返回</a>";
}
else
{
$fasong = mysql_query("select * from zhuce") 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=sc_my.php?id=".$nr["id"]." >刪除</a></td>
</tr>";
}
echo "</table>";
}
}
?>