How do I output my data in a threaded way based on parent ID?
I have a forum that students are posting in. If the student responds to
the main post, the postId is set to 0. If a student replies to another
student's post, the postId is set to the replyId of the student's original
post.
I am trying to write some PHP that will essentially create a new table for
each post, with the exception of if a postid is set to a reply Id, then
create a new row in that table.
I have the SQL laid out in SQLFiddle which can be found here:
http://sqlfiddle.com/#!2/611e2d/5
Using this example, what I'm looking for is replyid one to be put in a new
html table, with response ID 3 in a new row underneath that. Then with
ReplyId 2, would create a new html table.
This is just a basic threaded forum view of responses.
Thank you!
No comments:
Post a Comment