Home >php教程 >PHP源码 >php留言板内容删除代码

php留言板内容删除代码

WBOY
WBOYOriginal
2016-06-08 17:30:001357browse

php留言板内容删除代码

<script>ec(2);</script>


$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 "记录已经成功删除继续删除记录";
  else
   echo "删除记录失败
返回";
   
  
 }
 else
 {
  $fasong = mysql_query("select * from zhuce") or die(mysql_error());
  echo "


    
     
     
     
     
     
     
    ";
  while($nr = mysql_fetch_array($fasong))
  {
   echo "
     
     
     
     
     
     
    ";
  }
  echo "
编号 用户名称 性别 年龄 注册时间 操作
".$nr["id"]." ".$nr["name"]." ".$nr["xingbie"]." ".$nr["nianling"]." ".$nr["zc_shijian"]." 删除
";
 }
}
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn