This seems like a simple problem but I'm having difficulty finding the most efficient method. I have a DataTable with a list of comments (each row represents a comment). There can be replies to comments, so obviously I have to keep track of parent and child comments some how. So what I have is an id column and a parent_id column. the parent_id column points to the parent row if the comment is a reply obviously (0 if not).
I want to reorder my DataTable so that the comments are in order so I can display them on my page. I can change the DB structure if need and you think theres a better way butt hat my setup right now and I'm kinda stuck as to how to efficiently reorder my DataTable without having to call the DB again.
if you need any clarification. let me know.
Thanks in advance,