I think you are talking about nm relationships:
- Recipe May Have Many Spices / Meat / Veggies
- Each of the spices / meat / vegetables can be tied to many recipes.
As you usually store this in a database, there is a table of associations between the recipe and, for example, Veggies.
Recipe <----> RecipeVeggies <----> Veggies
The recipe and Veggies must have a unique primary key (id), and the RecipeVeggies table stores both primary keys to create a relationship between them.
Here is an example of a small structure:
Recipe : id, name, description Veggies : id, name RecipeVeggies : recipe_id, veggies_id
The RecipeVeggies table creates a repository for the relationship between Recipe and Veggie.
You should create similar tables for Spices and Meats.
I hope that I understand, otherwise you can ask more questions and I will improve my answer.
krtek source share