Reply
Use of Foreign Key References...
Old 08-20-2006, 11:24 PM Use of Foreign Key References...
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
Converting Video For YouTube
Posts: 2,337
Name: Keith Marshall
Location: West Hartford, CT
Can somebody explain to me how MySQL Foreign Key and References work and what do they do? Trying to look it up, but have not found any good documentation that explains how it works and the benifits from it.

__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-21-2006, 07:39 AM Re: Use of Foreign Key References...
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Am I impressed or what?
Posts: 14,831
Location: Blackpool. UK
In MySql only InnoDB tables support Foreign Key and Reference. So if you don't use InnoDB (the default is MyISAM) it's of absolutely no use at all.

FKs and references are about relationships between tables and to maintain referential integrity when deleting records.
Normally a FK would be the PK (Primary Key) of the table you are creating a relation with

FOREIGN KEY (column_in_table) REFERENCES parent_table(parent_field)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Use of Foreign Key References...
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.10635 seconds with 12 queries