From: "Richard Baskett" <[EMAIL PROTECTED]>

> Wouldnąt it just be easier to do a relationship table as in
>
> Personnel
> emp          ID   parent
> ========================
> 'Albert'      1     0
> 'Bert'        2     1
> 'Chuck'       3     1
> 'Donna'       4     0
> 'Eddie'       5     4
> 'Fred'        6     0
> 'Joe'         7     6
>
> This way you know the ID of the person and the parentID if they have one,
> otherwise they are a 0 which means they are the parent..  Seems like this
> would be a much easier way of doing it doesnąt it?  And only one SQL
> query...

Possibly. It depends on what you're trying to model. We're getting way off
topic for PHP, though.

What you gave above is called an adjacency list model and the other example
given was a nested set (or tree) model. Each has it's advantages and
disadvantages. I recommend counsulting your good friend Google if you're
interested in the details. :)

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to