The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Create foreign keys on Table Creation Only?

I've searched far and wide for a resource that clearly explains how to create a foreign key without success. I can't find the term "foreign key" in phpMyAdmin. I downloaded two other programs, MySQL Front and SQLyog, and I haven't yet found a "Create Foreign Key" command on either one.

The MySQL Manual says:

"You can create a foreign key by defining a foreign key constraint when you create a table."

Does that mean you can only create a foreign key when you're creating a table? if you create a table without specifying a foreign key, then fill it with data, you're out of luck?

To test it, I created a new table in phpMyAdmin, searching for the "Create Foreign Key" command. No luck.

But I assume one of these elements is supposed to link the foreign key to the PRIMARY KEY in the table I'm going to join it with, right? If that table is named Continents, and the primary key is named ID, what would my code look like?