I am coding PHP PM system right now. I am just looking for the logic behind it not the code. Everything goes good just with 1 problem.
You can imagine how things works;
- User A sends pm to User B (User A has this pm in his sent box)
- User B can see pm in inbox.
- User B can delete PM (user A still could see it in sent box)
- User A can delete PM in sent box (user B still could see it in inbox)
My logic got stuck after this part.
How do I show a pm to User A (in inbox) which User A sent to User B and User B replied?
Thank you for your help and time in advance.
Separate out the tables.
This is responsible for the message itself
This is responsible for linking/associating messages with users. This can take on properties to flag if it’s a “Sent” or “Received” message.
For better examples, check out phpBB’s tables, specifically the phpbb_privmsgs and phpbb_privmsgs_to tables.