【php开源代码栏目提醒】:网学会员php开源代码为您提供rule_forum.php参考,解决您在rule_forum.php学习中工作中的难题,参考学习。
<?
$link = mysql_connect("localhost","root","0721");
//联机
mysql_query("use
webdata");
//选择数据库
$sql= "delete from main where main_subject = '$main_subject' and main_name = '$main_name'";
mysql_query($
sql);
$result = mysql_query("select * from main order by main_time desc",$link);
//下 SQL 指令
/* 以
HTML Table 方式解析返回数据 */
echo "<table border=1>\n";
echo "<tr>\n";
/* 显示表头 */
while ($field =
mysql_fetch_field($result)) {
echo "<td>".$field->name."</td>\n";
}
echo "</tr>\n";
/* 印出表身 */
while ($row = mysql_fetch_row($result)) {
echo "<tr>\n";
for($i=0;$i<count($row);$i++){
echo "<td>".$row[$i]."</td>";
}
echo "</tr>\n";
}
echo "</table>\n";
/* 释放 result */
mysql_free_result($result);
/* 关闭连结 */
mysql_close($link);
?>
删除成功,<a href="rule.php">回上一页</a>