PHP删除注释错误

PHP删除注释错误,php,Php,好吧,问题是,我不能删除任何评论。。 我一直在看一些指南,但找不到太多帮助,下面是代码 <?php include "core/inc/conn.php"; mysql_select_db("comments"); $getquery = mysql_query("SELECT * FROM comments ORDER BY id DESC"); while($rows = mysql_fetch_assoc($getquery)) { $id = $rows['id']

好吧,问题是,我不能删除任何评论。。 我一直在看一些指南,但找不到太多帮助,下面是代码

<?php
include "core/inc/conn.php";

mysql_select_db("comments");

$getquery = mysql_query("SELECT * FROM comments ORDER BY id DESC");
while($rows = mysql_fetch_assoc($getquery))
 {
     $id = $rows['id'];
     $comment_name = $rows['name'];
     $comment = $rows['comment'];
     $dellink = "<a href=\delete.php?id=' . $id . \'> Delete </a>";


     echo"<tr><th>$id</th>";
     echo"<th><form action='checked.php' method='checked'></th>";
     echo "<th>$comment_name</th>";
     echo"<th>$comment</th>";
     echo"<th>$dellink</th>";
    echo"<th>$ipserver</th></tr>";


 }

    if(isset($_GET['error']))
{
    echo "<p>15 Bokstäver max!";

}


?>

响应删除链接的PHP不太正确,请尝试:

$dellink = '<a href="delete.php?id=' . $id . '> Delete </a>';
$dellink='';

*[必须不要使用mysql函数文本]*

危险:您正在使用并且应该使用。您也容易受到现代API的影响,因为它会使您更容易使用。当您单击“删除”链接时会发生什么情况?浏览器指向哪个URL?这就是你想要的URL吗?我正在为我的老师制作一个简单的网站,我们将在一些课程中使用它,我很确定它们不会损害数据库,不过,我对编码是新手,我真的不知道你刚才告诉我什么,抱歉,但谢谢!)URL一切正常,但id是错误的,它没有显示注释的id,而是在每个注释上显示/delete.php?id=%27.:/哦,终于!你的东西起作用了,但我以前试过,但没有显示任何效果,尽管它现在工作得很好!谢谢大家的回复!:)谢谢@Rikesh;)
$dellink = '<a href="delete.php?id=' . $id . '> Delete </a>';