Re: several pointers to records in one field
| From: | Ignatius Reilly | Date: | Mon, 17 Mar 2003 21:04:08 +0000 |
| Subject: | Re: several pointers to records in one field | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26453@lists.php.net to get a copy of this message | ||
The standard relational way is a relationship table:
children
---------
FK_parentID (parent)
FK_childrenID (child)
PRIMARY KEY ( FK_parentID, FK_childrenID )
HTH
Ignatius
____________________________________________
----- Original Message -----
From: "Alain Barthélemy" <cassandre@bartydeux.be>
To: "php-db" <php-db@lists.php.net>
Sent: Monday, March 17, 2003 6:36 PM
Subject: [PHP-DB] several pointers to records in one field
> Hello,
>
> I started to use PHP with MySQL last december.
> Personal use: list of inhabitants of a town in the 15th century
>
> Problem is the following: one person has an arbitrary number of children.
> It is heavy to have fields child1,child2,child3,...,childn containing the
row
> number of each child especially if the number of children is variable.
>
> When I played with Commodore VIC20 I used to put pointers to records in a
> string in the form pointer1,pointer2,...,pointern in a string.
>
> I think of using explode and implode to put all the record numbers of the
> children in one varchar field.
>
> If someone have a better idea?
>
> --
> Alain Barthélemy
> cassandre@bartydeux.be
> http://bartydeux.be
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>