You are building a "many to many" relationship.

How to do it:

* Each staff member should have an unique ID (eg StaffMember_ID) in the
Staff table;
* Each subject has an ID in the SubjectTitles table;
* and you need a third table, with two fields: StaffMember_ID and
SubjectTitle_ID, plus extra data if needed (eg: due date, assignment date,
comments, priority, ...)

When you assign a subject to a staff member, you add a record to that table.

Hope this helps you.

Regards,

Jean-Claude

----- Original Message -----
From: "Mark Worsdall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 20, 2001 9:22 PM
Subject: ADVICE: Best way to store multi values


> Hi,
>
> I have a table called staff which currently has a column called
> subjectTitles_id which is the type INTEGER.
>
> I have another table called subjectTitles which contains 12 subject
> titles.
>
> So that is how a member of staff is assigned a subject.
>
> Trouble is I need to be able to assign a multiple number of subjects to
> anyone member of staff.
>
> The method I thought to use was change staff.subjectTitles_id from
> INTEGER type to CHAR type and store a string of CSV numbers which
> correspond to the id's of the table subjectTitles, e.g.:-
>
> 1;2;7;10
>
> Is this the way?
>
> It seems quite ungraceful.
>
> M.
> --
> He came from Econet - Oh no, I've run out of underpants :(
> Home:- [EMAIL PROTECTED]         http://www.wizdom.org.uk
> Shadow:- [EMAIL PROTECTED]  http://www.shadow.org.uk
> Work:- [EMAIL PROTECTED] http://www.hinwick.demon.co.uk
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to