just some thoughts, this is a nice way of creating one "tree"-table of unlimited 
levels, top-level-items has for example parent_id -1, and if you want to get the items 
(the childs of a parent) just say 

select * from items where parent_id = x


create table items (
    item_id int unsigned not null auto_increment
    parent_id int unsigned not null default -1
    somedata varchar(1000)
)

kinds regards
Tomas

----- Original Message ----- 
From: "Realbad Atgames" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 1:12 AM
Subject: Hierarchical lists


> Hello, I'm new to MySQL and have ran into a problem in
> designing my database. I have a table of items, A, and
> each item should have any number of other records from
> another table, B, associated with it. I also need to
> have any number of records from table C associated
> with table B. They need to be associated in such a way
> that I can quickly find out what is associated with a
> record in table A, as well as what is associated with
> a record in table B. In other words, how do I store an
> array of pointers? What's the best way to do this? I
> couldn't find anything relevant in the docs.
> 
> Any help greatly appreciated.
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail. 
> http://personal.mail.yahoo.com/
> 
> ---------------------------------------------------------------------
> 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