Jump to content

Relate databases


x2fast

Recommended Posts

Background:

 

For class, we were assigned a "psuedo" project from general mills.  Basically something to waste our time, and suck out our lifeforce.

Everyone in my group is new to php/phpmyadmin/mysql.

XAMPP is installed properly on our machines.

All our DB's/tables are set to innoDB.  But the default is still set to myisam

We are to redesign their recipe database...

 

Question/problem:

 

I can't figure out how to relate 2 database tables....my brain hurts.

 

Example:

 

I currently have 2 databases, recipe_creators and recipe_data and 2 tables members and main (respectively).

The primary key for "recipe_creators" table "members" is creator_id.

The primary key for "recipe_data" table "main" is recipe_id.

 

I would like to have creator_id be a foreign key in recipe_data table main.  When I change creator_id in my "members" table I want it to automatically change in the "main" table in the other database.

 

Can that be done?  I apologize if this is in the wrong place.  This is a "find your own help" class, the teacher is just a supervisor.  Google is a better teacher (and more friendly/doesn't smell as bad). 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.