database design

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


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-22-2004
Stijn Goris
 
Posts: n/a
Default database design

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


Reply With Quote
  #2 (permalink)  
Old 08-22-2004
Geoff Berrow
 
Posts: n/a
Default Re: database design

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/
Reply With Quote
  #3 (permalink)  
Old 08-22-2004
Average_Joe
 
Posts: n/a
Default Re: database design

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:09 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0