I\'m trying to write a commenting system, where people can comment on other comments, and these are displayed as recursive threads on the page. (Reddit\'s Commenting system
Try using a nested set model. It is described in Managing Hierarchical Data in MySQL.
The big benefit is that you don't have to use recursion to retrieve child nodes, and the queries are pretty straightforward. The downside is that inserting and deleting takes a little more work.
It also scales really well. I know of one extremely huge system which stores discussion hierarchies using this method.