title: Messaging system in php mysql
body: <p>I created a simple messaging system on my website where new registered users can send message to one another. the following <code>mysql</code> statement works well on my site,but
  <strong>my problem is-</strong> when <code>UserA</code> sends a message to <code>UserB</code>, The message is shown to <code>UserB</code> in his Inbox, And The message is shown to <code>UserA</code> in his Outbox, now if for some reasons <code>UserB</code> deleted the message from his Inbox, then the message is deleted from both sides, I am storing all message in 1 table, <strong>now what I want to achieve is</strong> when the message is deleted from inbox it should still remain in Outbox, any help is much appreciated! thanks!</p>
  
  <p><strong>Table structure is as follows</strong></p>
  
  <pre><code>id   message    sentby   sentto    created
  </code></pre>
  
  <p><strong>Inbox.php</strong></p>
  
  <pre><code>$you=$_COOKIE['username'];     
  $st= "SELECT* FROM mbox WHERE sentto='$you' ORDER BY ID DESC LIMIT 10";
  </code></pre>
  
  <p><strong>outbox.php</strong></p>
  
  <pre><code>$you=$_COOKIE['username'];
  $st= "SELECT*FROM mbox WHERE sentby='$you' ORDER BY ID DESC LIMIT 10";
  </code></pre>