How was the thinkPHP Forum Post initiated after a new reply?

Source: Internet
Author: User
For example, I have two tables. one table T1 is used to store the topic, and the other T2 represents the id of T2 specifically used to store the reply content. it points to the id of T1 to distinguish which topic replies to all topics. sort by time in descending order, but generally the posts in the forum will be displayed if there is a new reply...

For example, I have two tables. one table T1 is used to store the topic, and the other T2 represents the id of T2 specifically used to store the reply content. it points to the id of T1 to distinguish which topic replies to all topics. sort by time in descending order, but generally the posts on the forum will be topped up if there is a new reply. if I design a table like this, how can I make this post with a new reply? what if it's still like this?$ T1-> order ('Time desc')-> select (); Certainly it won't work. how should we sort the table? I thought about using join or something before, but it cannot be done. Is it unreasonable for me to design the table like this? How should I do it? My TP

Reply content:

For example, I have two tables. one table T1 is used to store the topic, and the other T2 represents the id of T2 specifically used to store the reply content. it points to the id of T1 to distinguish which topic replies to all topics. sort by time in descending order, but generally the posts on the forum will be topped up if there is a new reply. if I design a table like this, how can I make this post with a new reply? what if it's still like this?$ T1-> order ('Time desc')-> select (); Certainly it won't work. how should we sort the table? I thought about using join or something before, but it cannot be done. Is it unreasonable for me to design the table like this? How should I do it? My TP

Add the last_reply_time field to table t1 to indicate the last reply time. then insert the field t2 and update it accordingly.

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.