title: Updating column from one table based on changes in another table
body: <p>Forgive me as I'm new to databases. I have a recipe form that the user can enter several ingredients and the recipe name into. With this form I have the following tables: <code>Recipe{recipeID, recipeName}</code> <code>RecipeIngredient{recipeID,ingredientID,measurement}</code> <code>Ingredient{ingredientID, ingredientName}</code></p>
  
  <p>RecipeIngredients acts as an intermediate table for the one to many relationship (one recipe to many ingredients). I assigned recipeID as a foreign key inside that table to the primary key recipeID in the recipe table. I thought a foreign key would update based on the primary key updating, but if I insert into the Recipe table the RecipeIngredients table does nothing.</p>
  
  <p>The recipe and the ingredients are assigned ID's automatically.I'm trying to link the ID of one recipe to the auto assigned ID's of each ingredient. For example if the user enters in 8 ingredients, a unique ID is assigned to each of those ingredients. I need the RecipeIngredients table to duplicate those ID's and associate them with the auto-assigned Recipe ID.</p>
  
  <p>I've tried several solutions for updating a column based on changes in other tables. I've tried modifying <a href="https://stackoverflow.com/questions/6973469/update-table-based-on-column-in-another-table">this</a> MySQL update statement and also modifying <a href="https://stackoverflow.com/questions/6023367/update-table-based-on-another-table">this</a> SQL server but I can't seem to get either of them to work.</p>
  
  <p>Suggestions?</p>