Re: Relational mySQL in PHP
| From: | Troy Hakala | Date: | Wed, 02 Aug 2000 04:36:54 +0000 |
| Subject: | Re: Relational mySQL in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9629@lists.php.net to get a copy of this message | ||
if i understand this correctly, this is a general database question, not
specific to MySQL, SQL or PHP.
it depends on your data and what you want to do, but typically, each row is
uniquely distinguishable in some way so your references in one table that
point to another table also contain those columns that distinguish the rows
in the other table. (does that wording make sense at all?) the simple case
is where each row has a unique ID, for example, an employee ID. then you
just use the ID in all the other tables that reference that employee. this
is an extremely common technique in all database designs, SQL being no
different.
the SQL "join" keyword is what you want to look into.
troy@recipezaar.com
----- Original Message -----
From: "John Coggeshall" <someone@internetaddress.com>
To: "Chris Adams" <chris@digitaria.com>; "php-general"
<php-general@lists.php.net>
Sent: Monday, July 31, 2000 8:12 PM
Subject: [PHP] Relational mySQL in PHP
>
> Hey all
>
> Okay, Maybe this is a mySQL question.. sorry if it is.
>
> What I have is a primary table, in this table, I want to store certain
> references to rows in other tables. What's the best way to do this using
> PHP? Is there a better way to do it using pure mySQL?
>
> John
>
>
> -----Original Message-----
> From: Chris Adams [mailto:chris@digitaria.com]
> Sent: Tuesday, August 01, 2000 11:10 PM
> To: php-general
> Subject: Re: [PHP] Check input against list
>
>
> > The countries array is 232 entries, states 59.
> > I'm not sure it's worth putting into the DB.
>
> That's definitely small enough to include inline, particularly as the list
> of states and countries isn't going to change frequently. I used a MySQL
> table largely because I had a couple of tables & queries where an
> abbreviation -> full name lookup table came in handy; absent such reuse
it's
> probably not worth the effort.
>
>
> Chris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>