Use three tables, one from projects one for members one for assignments

Projects
================
projectid
projectname
length
description
and whatever else


members
===============
memberid
name
category


workingon
================
memberid
projectid

so each member can be in one or many projects and each project can have one
or many members
if members can only be on one project then you could in theory do it with
tables

so to sellect all members of project with id X

SELECT m.* FROM members m, workingon w WHERE m.memberid=w.memberid AND
w.projectid=X

Hope this helps,
----- Original Message -----
From: "garman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 06, 2001 2:53 PM
Subject: [PHP] storing team members---suggestions on approach?


> I've got a fairly simple problem, and I'm not really sure how to approach
it.
> I'm creating a website for team projects, where the project information is
> stored in a MySQL database.  I want folks to be able to name their
project,
> indicate it's length, have a verbal description, etc.  The gathering and
> handling of that information is fairly straightforward.
>
> Each team project obviously has team members.  But the number of team
members
> is variable.  Furthermore, team members can be in one of two categories.
I'm
> not really sure how I should best store team members in the database.
> Ideally, it would be nice to have a database field for every team member,
but
> if there is ever a team with one more member than I have fields... that's
a
> big problem.  So my other thought was to just have two fields for team
members
> (one for each category), and within that field just have a comma (or
> semicolon, etc) delimited list of employee names.  Another thought is to
make
> a table just for employees, where one field of that table maps the
employee to
> a project (project are contained in another table).  That table could also
> have a field that indicated the member's category.
>
> Any thoughts on my current ideas, or suggestions for something better?
>
> Thanks!
> Matt
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to