Private messages feature design help!

Source: Internet
Author: User
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?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.