HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank

Reply to topic Page 1 of 1
Comments tree
Message  

Reply with quote
Post Comments tree 
Hey people!

I have a self-referencing table:

id {PK}
comment
parent {FK}

Here parent is the foreign key to the id of this table. I need to create the comment tree, something like:

this is my comment
  this is reply to comment
    this is a reply to 2nd comment
this is new comment


Usually I do this by building an array with tree structure having made only 1 SQL query. I just wanted to find out if there is any new and more optimum way to do that.

Thanks in advance,
Tim.

P.S. Please do not offer recursive functions Smile


_________________
First free hosting reseller program
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Reply with quote
Post  
Recursive functions are evil...

I'm intrigued as to how you do it with only 1 SQL query? I do not know a better way.


_________________
http://www.pegproductions.com - Peg Productions Web Design
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  




FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Web Hosting
Web Hosting and Dedicated Servers Advertise Here $10 a Month Designer Children
Insurance HGH Domain name registration
Affordable web-hosting Dedicated Server Management

Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com