Re: grabbing from multiple tables

From: Date: Fri, 30 Apr 2010 10:31:13 +0000
Subject: Re: grabbing from multiple tables
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-47104@lists.php.net to get a copy of this message
On 30 April 2010 12:26, Karl DeSaulniers <karl@designdrumm.com> wrote: > Thanks Peter. > So what is the logic behind foreign keys? Why use them? Constraints. When using, for example, the InnoDB engine in MySQL, you can set foreign key fields on tables. These ensure that your record will always be bound to a proper record in the connected table - so, for instance, you won't find yourself in the situation that you have deleted a record from table1 but table2 still references the table1 record. Also, they're very useful for tying models together automatically, as you can deduce relationships between models by foreign keys, for instance (this is simplified but covers a lot of cases). Regards Peter -- <hype> WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 </hype>

« previous php.db (#47104) next »