murra1a Posted August 27, 2008 Share Posted August 27, 2008 Hi, I have 3 tables: ingredient, recipes, onhand ingredient is 2 fields: key, name recipes is several fields, important one is ingredients which is keys from ingredients table separated by commas eg 2,3,15,99 this essentially connects the list of ingredients in the recipe to ingredient names in the 1st table the third table is a list of ingredients I have on hand and their keys from the ingredient table. What I want to do is to search the recipe table for recipes I can make with the ingredients I have on hand and recipes for which I am missing only a few ingredients I am completely confused about how to do this Thanks Ryan Quote Link to comment Share on other sites More sharing options...
webent Posted August 27, 2008 Share Posted August 27, 2008 It would help if you would post at minimum your table structure... Also, I'm thinking an "ingredient_to_recipe" table would work nicely, just from what I can understand without seeing the table structure. Quote Link to comment Share on other sites More sharing options...
murra1a Posted August 27, 2008 Author Share Posted August 27, 2008 Here is a sample of the three tables Ingredients: Key Ingredient 1 Bacon 2 Tomato 3 Lettuce 4 Bread 5 Eggs Recipes: Recipe Ingredients BLT 1,2,3,4 Bacon and Eggs 1,5 OnHand: StuffOnHand IngredientKey Bacon 1 Tomato 2 Eggs 5 I want to output: 1. That I can make bacon and eggs 2. That I can make a BLT if I get Lettuce and Bread I hope that is more clear Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.