Create a private messaging feature similar to the OSC website (php+mysql):
1. On the list page, list all the private messages I send and send to me, the same person of course only shows the last one sent out, or received
2. View page to list all conversations between two people
How to design a data sheet?
How to read the list page?
Reply content:
Create a private messaging feature similar to the OSC website (php+mysql):
1. On the list page, list all the private messages I send and send to me, the same person of course only shows the last one sent out, or received
2. View page to list all conversations between two people
How to design a data sheet?
How to read the list page?
I said a simple one.
A table is enough for a small capacity.
Field includes primary key ID parent ID Sender ID Receiver ID content send time
All private messages are stored in this format
The parent ID of the first private message that was sent for the initial 0
Reply or continue sending the parent ID is the primary key ID of the first private message
View the details of a private message you can get the ID of the first one. After querying the parent ID field, arrange by time
Message list words query user ID sender or receiver filter out last reply in conversation with group and having group
In short, the implementation of the method has a lot of data table design complex logic plane simple data table simple logic layer will be complex pros and cons can be
The parent ID here doesn't seem to work, does it?