CodeIgniter Forums
Hierarchical Comments in MySQL Script - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Hierarchical Comments in MySQL Script (/showthread.php?tid=6320)



Hierarchical Comments in MySQL Script - El Forum - 02-22-2008

[eluser]section31[/eluser]
Does anyone know where I can find an open source script so I can just look at that does nested comments.

This website does nested comments along with many more.

http://www.moddb.com/events/2007-mod-of-the-year-awards/features/25910/players-choice-winners-showcase

I want to do this the right way so recursion is not an option since that's very inefficient.


Hierarchical Comments in MySQL Script - El Forum - 02-22-2008

[eluser]Negligence[/eluser]
You can do nested-anything by storing the comment's parent id in the comment record. Anytime you look up a comment, check to see if there's any other comments who parent_id equals the comment_id of the record.


Hierarchical Comments in MySQL Script - El Forum - 02-22-2008

[eluser]section31[/eluser]
I wanted to do something more like this.
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html