Design Hierarchy Data

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
cade
Forum Commoner
Posts: 55
Joined: Tue Jul 03, 2007 8:18 pm

Design Hierarchy Data

Post by cade »

I'm planning to develop system for multi level marketing for my study. Now i'm referring the http://dev.mysql.com/tech-resources/art ... -data.html article for the design. I use the nested set model as it more efficient. But to implement it in PHP seems difficult to me. because the value of right and left caused difficult for me to add new node or deleting it.

Appreciate if there are working example for such this data set
cade
Forum Commoner
Posts: 55
Joined: Tue Jul 03, 2007 8:18 pm

Re: Design Hierarchy Data

Post by cade »

Hi again :p

I'm testing the adjacency model as it less complicated. But now having problem of finding sibling node. Is anyone can show the right way
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: Design Hierarchy Data

Post by ghurtado »

If I understand it well, the adjacency model is the one that uses "parent_id" as a means to relate the nodes in a hierarchical structure. If so, wouldn't it be very simple to select all nodes that share the same parent_id? (that is to say, which are siblings)
cade
Forum Commoner
Posts: 55
Joined: Tue Jul 03, 2007 8:18 pm

Re: Design Hierarchy Data

Post by cade »

owh...yeah. You really help me. Thanks anyway. Is there any guy have been working on this set of data and would like to share your working DB here
Post Reply