title: How to delete the message received and sent by Member A from the chat without deleting it in member B's account
body: <p>I have a table where i store the chat informations between 2 members (Member A and Member B). Now when Member A delete his messages i throw an sql request like this</p>
  
  <pre><code>$deleting = mysqli_query($connection, "DELETE FROM `mychattable` WHERE (`from`='$id_of_member_a' AND `to`='$id_of_member_b') OR (`from`='$id_of_member_b' AND `to`='$id_of_member_a') ") or die(mysqli_error($connection));
  </code></pre>
  
  <p>When i do that the problem is that it deletes the messages from both Member A and Member B's account.</p>
  
  <p>I have also tried </p>
  
  <pre><code>$deleting = mysqli_query($connection, "DELETE FROM `mychattable` WHERE `from`='$id_of_member_b' AND `to`='$id_of_member_a' ") or die(mysqli_error($connection));
  </code></pre>
  
  <p>But when i do that it deletes the messages of Member A from the database so Member B no longer has access to it</p>
  
  <p>How to delete the message received and sent by Member A from the chat without deleting it in member B's account ?</p>
  
  <p>This is the structure of my table</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `mychattable` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `from` int(10) unsigned NOT NULL,
    `to` int(10) unsigned NOT NULL,
    `message` text NOT NULL,
    `sent` int(10) unsigned NOT NULL DEFAULT '0',
    `read` tinyint(1) unsigned NOT NULL DEFAULT '0',
    `direction` tinyint(1) unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`),
    KEY `to` (`to`),
    KEY `from` (`from`),
    KEY `direction` (`direction`),
    KEY `read` (`read`),
    KEY `sent` (`sent`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=29 ;
  </code></pre>
  
  <p>Thanks</p>