How is a comment table similar to a QQ space designed?

Source: Internet
Author: User
This is similar to how the comment table of the QQ space is designed. If a table exists, can I use only one statement to query and process it? Can only be queried twice? ------ Solution ---------------------- one item can be used. php can process unlimited categories. ------ Solution -------------------- reference: Quote: reference how the comment table similar to the QQ space is designed.

If a table exists, can I use only one statement to query and process it? Can only be queried twice?
------ Solution ----------------------
One line is acceptable. php can process unlimited classification.
------ Solution ----------------------
Reference:
Quote: reference:

Quote: reference:

Quote: reference:

Quote: reference:

Quote: reference:

Once OK, the structure is self-assembled

With the paging function...
For the time being, you can think of reading all data at a time, and the program will split the page by itself. In order to prevent confusion, the last ID of each page is used as the parameter to pass out, and the next page is requested as the paging basis.

Will it be too difficult to retrieve all pages every time ..

It is either difficult to obtain data, or it is more difficult to store data. The main reason is that such comments are not in absolute order. It is difficult to have too many comments such as QQ, so there is no problem in obtaining all the comments at a time.

Is to retrieve each page once, and QQ can also support second-level collapse to expand comments

I mean that all data is read out by page every time a request is made, and the database needs to be read once every time the next page is clicked. It's just a front-end trick to hide the second-level comments.
------ Solution ----------------------
Yes. the first time I read the first comment, the second time I read the second comment of the first comment.
That is, all are collapsed at the beginning. click to expand.

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.