* Devin Miller
[...]
> thought that since name_id in the emails table would be handled
> automatically by mysql since it is a foreign key. Is this a wrong
> assumption? Is it the job of the application to do this?

Yes & yes. :)

Note the difference between a "foreign key" and a "foreign key constraint".
A foreign key is a column (or columns) referencing a different table, while
a "foreign key constraint" is a rule defined in a table, constraining the
database manager to only handle valid foreign keys. The InnoDb table handler
supports foreign key constraints, the MyIsam handler does not.

<URL: http://www.mysql.com/doc/en/ANSI_diff_Foreign_Keys.html >
<URL: http://www.mysql.com/doc/en/example-Foreign_keys.html >
<URL: http://www.mysql.com/doc/en/SEC452.html >

Ignore the first sentence of the first paragraph of the first link, it is
confusing...: "Note that foreign keys in SQL are not used to join tables,
but are used mostly for checking referential integrity (foreign key
constraints)."

Should have been: "Note that foreign key constraints are not needed to join
tables, they are only used for checking referential integrity." or possibly
"Note that the words 'foreign keys' in MySQL are not used to join tables,
but are used mostly when referring to referential integrity (as in 'foreign
key constraints').

--
Roger


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