This is a discussion on database design within the PHP Language forums, part of the PHP Programming Forums category; Hi all, My website needs to order some groups (tblgroup). Groups hold users (tblusers) and can hold other groups (so ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi all,
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. thanks Stijn |
|
|||
|
I noticed that Message-ID: <41288509$0$4142$ba620e4c@news.skynet.be>
from Stijn Goris contained the following: > I have come up with some dbase design but >would like to see your optinion and hoping the design is more elegant. I'll show you mine if you show me yours... -- Geoff Berrow (put thecat out to email) It's only Usenet, no one dies. My opinions, not the committee's, mine. Simple RFDs http://www.ckdog.co.uk/rfdmaker/ |
|
|||
|
In article <41288509$0$4142$ba620e4c@news.skynet.be>, Stijn Goris wrote:
> Hi all, > > 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. > > thanks > Stijn 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 subgroups, however. Jamie -- http://www.geniegate.com Custom web programming User Management Solutions Perl / PHP / Java / UNIX |