Building a Food Recipe website. |
You need the users ID added to each entry in the recipes table, so that you know what recipes belong to what user.
But you do not need to have the users ID in the other tables though, they only need the "parents" id. That would mean recipes ID for ingredients & direction tables. And measurements only need the ingredients ID. In a try to describe the relations.
I would do the setup this way Users id name password Recipes id users_id name image rating Ingredients id recipes_id name sive Directions id recipes_id direction prep_time cook_time Measurements id ingredients_id name I would also recommend setting up relations so that if a recipe is deleted from the database, all entries in ingredients, directions and measurements that belong to that recipe get deleted from the database automatically. Here is some information on that. |
Messages In This Thread |
Building a Food Recipe website. - by bellsdesign - 04-01-2015, 12:11 PM
RE: Building a Food Recipe website. - by silentium - 04-01-2015, 05:08 PM
RE: Building a Food Recipe website. - by bellsdesign - 04-01-2015, 06:56 PM
RE: Building a Food Recipe website. - by RobertSF - 04-02-2015, 12:23 AM
|