Hi Daniel,

You wrote:

> what i'm trying to do is have one table for a member base, and have each
> member capable of having a list of items of a varying number.
> when i first thought about doing this i thought there may have been a
field
> type that would act as a linked list.. kinda like a set, but you can add
or
> delete items.

As I expect Joseph Jude is going to point out, when you think you want a
linked list in a database, what you usually want in a relational database
like MySQL is more tables.

For instance, you can have the member table:

member:
    member_id, member_name, member_unique_property

and a property table:

non_unique_property:
    owner_member_id, property_name, property_attribute

When you want the non-unique properties for the member, you do something
like

    select ... from non_unique_property where owner_member_id = {put the
member_id in here};

(I'm thinking of php or perl, where you can build the search string before
you issue it.)

If your member table is supposed to be linking to other members in the same
table, you can use a link table to provide directed links:

member_link:
    referred_from_id, referred_to_id

If you need non-directional links, you'll need to add a little logic to
check the left and right links. Either always match and delete in pairs, or
search for a member_id in both link fields.

Since following links in a table requires chasing records down in possibly
widely separated places on the disk, it is usually best to avoid actual
linked lists in tables.

Joel Rees
Alps Giken Kansai Systems Develoment
Suita, Osaka




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