Earlier quoted context omitted.
How do you get the full thread for a given parent? Selecting based on the parentid alone gives you only immediate descendants. Recursive queries are generally a no-no, as they drag your performance down fairly quickly. Selecting based on the newsid gives you every single comment on the item, and then you'll have to do a lot of work (basically building up the full tree structure in memory) to find out which are childr…
You would find the full thread by searching for comments with the appropriate newsid. To simplify the recursive function (using data in memory, not in the database), you could also have another field, called indent, that stores the level in the comments. You could find all the comments with one SQL statement (where newsid = news.id), then go through each level of each comment, and sort it that way. You could even mak…
in html for that.