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
https://forums.phpfreaks.com/topic/89243-relate-databases/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.