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.