title: PHP query not updating in db throught form
body: <p>i'm working on a project that includes a minimail/chat function that has the option to tick off when u have read the message and flag a user.</p>
  
  <p>The flag and tick off options doesnt work anymore after i eddited something but i cannot find the problem anymore.</p>
  
  <p>The game doesnt support newer versions of PHP for now.</p>
  
  <ul>
  <li>$m['id']; = 22</li>
  <li>$m['read'] = 0 </li>
  </ul>
  
  <p><strong>Query 1 =</strong>
  array(3) { ["id"]=> string(2) "28" ["mark_read_x"]=> string(2) "10" ["mark_read_y"]=> string(2) "10" }</p>
  
  <p><strong>Query 2 =</strong>
  array(3) { ["id"]=> string(2) "28" ["flag_user_x"]=> string(1) "8" ["flag_user_y"]=> string(1) "4" }</p>
  
  <pre><code>&lt;?php
     $mid = $m['id'];
  
     if(isset($_POST['mark_read'])){
      $mid2 = $_POST['id'];
      $query2 = "UPDATE `user_messages` SET `read` = '1' WHERE `read` = '0' AND `user_messages`.`id` = '$mid2'";
      mysql_query($query2) or die(mysql_error());
      header("Refresh:0");
      }
  ?&gt;
  
  &lt;?php if($m['read'] === '0'){ ?&gt;
  
  &lt;form method="post"&gt;
     &lt;input type="hidden" name="id" value="&lt;?php echo $mid; ?&gt;"&gt;
     &lt;input src="tick.png" title="Mark as read" type="image" alt="submit" name="mark_read"&gt;
  &lt;/form&gt;
  
  &lt;?php } else { echo ''; } ?&gt;
  
  &lt;?php
     if(isset($_POST['flag_user'])){
      $mid2 = $_POST['id'];
      $query3 = "UPDATE `user_messages` SET `flagged` = '1' WHERE `flagged` = '0' AND `user_messages`.`id` = '$mid2'";
      mysql_query($query3) or die(mysql_error());
      header("Refresh:0");
     }
  ?&gt;
  
  &lt;form method="post"&gt;
     &lt;input type="hidden" name="id" value="&lt;?php echo $mid; ?&gt;"&gt;
     &lt;input src="exclamation.png" title="Flag message" type="image" alt="submit" name="flag_user"&gt;
  &lt;/form&gt;
  </code></pre>