Hi
The user clicks on a buttons to delete all posts in a thread (this also deletes the parent post). The code is bellow. This however isnt working, its deleting all the parent posts, even those that dont correspond to the topic clicked on. Any ideas
if (isset ($_GET['delete']) && $_GET['delete'] == true) {
$id=$_GET['postid'];
$query = "DELETE FROM forum WHERE postid = '$id' OR parentid = '$id'";
if (mysql_query($query)) {
echo "<p width=700px>You have succesfully deleted the topic. Thankyou for keeping the forum clean. <br><a href='forum.php'>Back to forum</a><br><img src='images/tick.png'>";
include 'include/bottom.php';
die();
}
else
$msg = "<p width=700px>You have tried to delete this message. However the following is stoping you: <br> <h3>Incorrect Priviledges</h3><br><a href='forum.php'>Back to forum</a><br><img src='images/cross.png'> ";
include 'include/bottom.php';
die();
}