database design

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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.


Re: database design

Quoted text here. Click to load it

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.

--                      Custom web programming
User Management Solutions                   Perl / PHP / Java / UNIX

Re: database design

from Stijn Goris contained the following:

Quoted text here. Click to load it

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 /

Site Timeline