Hi
I am developing a program in which the user can post his message.(Like discussion forum).
Any user can reply for this.If the user post the first message the message id will be 1.
The first reply will have the id value 2 and the next will have a id value 3... and so on.
Meanwhile if any one post a new message in between the third message(That is second reply for the first message) it's id will have a value 3.Now the second reply for the first message will have value 4.I have desined the database like this.
master database details
id
message_detail
posted date
...
Details database
id
parent_id
reply details
....
The id in both tables will be automatically incremented for each message.(The reply message also have new id and will have its corresponding parent id in the detail table.)
when the user visit to this message page i want to display all message details in the following order(like in this discussion forum).
message1
message2(reply for messge1)
message3(reply for message2)
message4(reply for message1)
message5 (new message)
...
Can anyone help me to do this.
Thanks your help in advance.