In a web application, there are messages (text) sent from one user to another in the system. Both users are stored in a user table and each message is held in a message table. The user table contains a one-to-many relation to the message and the message contains all the data associated with what was sent.
However, I would like to track the messages, so that reply’s on a message are tracked together. i.e. if User A sends message to User B and User B sends a reply, then User A would see a layout something like:
message 1
message 2
How do you model messages in a database, when the messages need to be tracked as to which message is a reply and which messages are another “thread”?
Thanks.
Maybe try to add an Auto Increment
idfield to every reply. Then add a field [let’s name it:replyto].replytowould contain theidof the message it was sent as a reply to. Then just play around the HTML and CSS to create styles to display the different “threads”.Hope this helps.