Each member can have several interests, and each interest can be held by several members. The best way to do this is with a third table relating the two:

  CREATE TABLE member_interests
    (member_id INT, interest_id INT,
     UNIQUE INDEX mem_int_idx (member_id,interest_id);

Each row in this table represents one interest for one member. If the table held these rows:

member_id  interest_id
  1           1
  1           5
  1           17
  2           5
  2           13

then the member with ID=1 holds interests with IDs 1, 5, and 17, while the member with ID=2 holds interests with IDS 5 and 13.

Michael


Robb Kerr wrote:

I have come across this problem a few times and wondered how other people
solved the problem.

Let's say I have a table containing Members. Each Member can choose several
items in which they are interested. Each of these items represent records
in a separate table - Interests. How do you store which records from
Interests the member has checked in their record of the Members table?

Do you create a TEXT field in the Members table and save a comma-delimited
string of InterestsIDs?

Thanx.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to