title: How do i make delete button work?
body: <p>I am trying to make a delete button but it doesn't work.</p>
  
  <pre><code>$interogare = "SELECT * FROM comments JOIN users ON users.user_id = comments.user_id WHERE movie_id='$movie_id' ORDER BY date_posted DESC";
      $result = mysqli_query($dbc, $interogare) or die(mysqli_error($dbc));
      while($rand = mysqli_fetch_assoc($result))
      { 
           echo '&lt;a href="film.php?com='.$rand['comment_id'].'"&gt;Delete&lt;/a&gt;';
  
           if(isset($_GET['com'])) {
  
              $haidi = mysqli_real_escape_string($dbc,$_GET['com']);
              $sql_del = "DELETE FROM comments WHERE comment_id = '$haidi'";
              mysqli_query($dbc,$sql_del);
              header('location: film.php?id='.$_GET['id'].'');
              exit();
           }
  
       }
  </code></pre>
  
  <p>When i click the delete link it takes me to </p>
  
  <blockquote>
    <p>film.php?com='.$rand['comment_id'].'</p>
  </blockquote>
  
  <p>page but nothing happens,it should delete my comment and take me back to the page where the comment was.Can someone please help me figure this out ?</p>