Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- database design
- Stijn Goris
August 22, 2004, 6:36 pm
rate this thread
My website needs to order some groups (tblgroup). Groups hold users
(tblusers) and can hold other groups (so called subgroups). Users can be a
member of multiple groeps. Groeps can hold more than one user. There only
has to be one level of subgroups. I have come up with some dbase design but
would like to see your optinion and hoping the design is more elegant.
Re: database design
Thats fairly straight-forward. My package allows multiple groups pr.
user, but doesn't do the subgroup thing. (No real need for it, why do
you need subgroups?)
Just add a "parent-id" column to your group table, using 0 as "no
parent". Then groups can be nested as far as you like. (Simply "travel
up" the parent tree until you get to 0)
For speed, or relational joins, you'll probably want another table of
http://www.geniegate.com Custom web programming
User Management Solutions Perl / PHP / Java / UNIX