Deleting with 3 verifiers
I need to delete something with 3 verification checks. how can i do it. Currently this is the way i am doing it:
mysql_query("DELETE FROM comments WHERE co开发者_高级运维mment_id='$comment' AND (
p_id='$pid'
for_w = '$z'");
What about:
"DELETE FROM comments WHERE comment_id='$comment' AND p_id='$pid' AND for_w = '$z'"
You're almost there:
mysql_query("DELETE FROM comments WHERE comment_id='$comment'
AND p_id='$pid'
AND for_w = '$z'");
1 - You have to put AND between your second and third condition
2 - Remove ( after the first one:
mysql_query("DELETE FROM comments WHERE comment_id='$comment' AND
p_id='$pid' AND
for_w = '$z'");
精彩评论