I have MySQL table messages to allow users of my new site to send private messages to one another, while I was coding the message page I realize that if user1 send message to user2 and after sometime user2 decides to delete the message in he's inbox then the message from user1 inbox will also be deleted, I would like to be pointed on how can I figure this so user1 or user2 should only delete the message in he's inbox? Maybe this will needs to create every user table or what kind of concept is behind this?
I have tried multiple inserting with different ID's based on the people sending messages like sending one message two times to server so user1 should have he's own message also user2 but this besides being bad programming it seems not also be possible because in the html form the receiver can't change to be sender. I try to vice verse (swap) the variables on insetting .PHP page to get original receiver to sender, so I can just echo the messages using session user data but this is coursing the user2 to see all the messages like have been send by him while user1 sees the messages the way it suppose to be.
if my codes will be needed please let me know so I can provide.