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.