create a sub table with an user id column and a team column...runs
vertically instead of horizontally
bastien
From: "William Stokes" <kalles@xxxxxxxxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject: App. design help
Date: Tue, 14 Nov 2006 15:18:29 +0200
Hello,
I need to write a php/mysql application for managing a website for a
sportsclub. At his point I need some designin tips how to implement the
user
and team administration.
At the moment the club consists of about 30 teams. There are usually 1-2
web
admins per team to update the pages. The current -crappy- system now has 5
columns in the user database table and in these columns there are the team
id's of the teams that the users has rights to.
Like this:
USER TM1 TM2 TM3 TM4 TM5
JohnW 7 6 12 3
Which gives JohnW access to team's (id) 7,6,12 and 3. Main problems with
this system are that user access is limited to max 5 teams and that if you
add a new team to club theres now way automatically assing admin for that
team.
Team id's come from the teams table. Both teams and users are now
administered manually by modifying the DB tables.
So how to write a system that is able to add/remove teams. And here I refer
mainly to the DB desing (I figure out the code later). Can I put the team
id
to the column name in the users table and like X to the right field and
add/remove columns when teams are added or removed. Can I write SQL queries
that return column names that has an X in them where user=user to get the
team id's that user has access to???
There must be some 'normal' way to do things like this. So please point me
the way.
Thanks
-Will
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________
Say hello to the next generation of Search. Live Search ? try it now.
http://www.live.com/?mkt=en-ca
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php