Create a private message function (php + mysql) similar to the OSC Website: 1. list all the private messages I sent and sent to me on the list page. Of course, only the last one sent or received is displayed for the same person. how can I design a data table that lists all the dialogs between two people on the view page? How to read the list page? Create a private message function (php + mysql) similar to the OSC Website ):
1. list all the private messages sent and sent to me on the list page. Of course, only the last one sent or received is displayed for the same person.
2. view the page to list all conversations between two people
How to design a data table?
How to read the list page?
Reply content:
Create a private message function (php + mysql) similar to the OSC Website ):
1. list all the private messages sent and sent to me on the list page. Of course, only the last one sent or received is displayed for the same person.
2. view the page to list all conversations between two people
How to design a data table?
How to read the list page?
Let me make it simple.
If the capacity is small, one table is enough.
Fields include primary key id parent id sender id receiver id content Sending time
All private messages are stored in this format.
The parent id of the first private message sent for the first time is 0.
If you reply or continue sending the message, the parent id is the primary key id of the first private message.
View the private message dialog details, and you can use the id of the first private message to go to the parent id field for query and sort it by time.
If the private message list is used, the user ID sender or receiver can use the group and having groups to filter out the last reply in the dialog.
In short, there are a lot of methods to achieve data table design. The logic layer is simple. Some data tables are simple. The logic layer will be complicated and weigh the advantages and disadvantages.
The parent id here seems useless, right?