Using Foreign Keys in MySQL
On the article at php|architect, Ligaya Turmelle explains you how to handle Foreign Keys in MySQL so they can serve your whims.
No, foreign keys aren’t from Brazil or Italy or even the US. Though they can be a bit strange to those who do not understand them, have no fear. We are here to teach you how to talk to them so they can serve your whims. So what are foreign keys exactly?
Not to put too fine a point on it, they are what make a relational database â€œrelational.â€ They are the links between tables that keeps everything connected. They are what allows you to put a customer in one table and their order in another and the products they are ordering in a third table so the database has minimal data redundancies.
She continues with the article with a good example. Read it