使用3个验证程序删除

时间:2011-05-19 13:52:01

标签: mysql sql

我需要删除3次验证检查。我该怎么做。目前这就是我这样做的方式:

 mysql_query("DELETE FROM comments WHERE comment_id='$comment' AND (
 p_id='$pid'
 for_w = '$z'");

3 个答案:

答案 0 :(得分:2)

怎么样:

"DELETE FROM comments WHERE comment_id='$comment' AND p_id='$pid' AND for_w = '$z'"

答案 1 :(得分:1)

你快到了:

 mysql_query("DELETE FROM comments WHERE comment_id='$comment' 
                                   AND p_id='$pid' 
                                   AND for_w = '$z'");

答案 2 :(得分:1)

1 - 你必须在你的第二和第三个条件之间加上AND 2 - 删除(在第一个之后:

mysql_query("DELETE FROM comments WHERE comment_id='$comment' AND
 p_id='$pid' AND
 for_w = '$z'");