I've been trying to solve this problem for several hours without any
success so I decided to seek help.
I have a text database containing comments for a discussion board with the
following structure that I want to sort and present in HTML format.
* Each comment receives a thread id (If a comment is a reply, it will
receive the thread ID of the parent ) --- $threadID
* Each comment has a unique $commentID
* If a comment is a reply; the comment will get the $commentID of the
parent and set it as the $replyto field (else $replyto is 0 to signify a
* The actual comment is stored in $comment
The structure of the file is somewhat like this:
I'd like to sort the comments by threadID and check if each message has a
reply; if so display it right after the comment and make it appear nested.
This is an example of what I managed so far:
I didn't manage to display the comments quite as I wanted (as you can see
from the page where message #4 does not appear as a reply to #2) and the
code looks ugly (and I'm embarassed to show it), so I will not post it
Suggestions on how to tackle the problem anyone? I'm not using CGI.pm