title: PHP MySQL recipe search based on what ingredients are provided
body: <p>Say I have a database of recipes, and I want to search through them based on what ingredients I have.</p>
  
  <p>There should be 3 tables:</p>
  
  <p>Recipes (rid, rname),<br/>
  Ingredients (iid, iname),<br/>
  Relationship (rid, iid)</p>
  
  <p>Next, lets imagine I have a recipe for 'toast' and a recipe for 'bread and butter pudding' - Toast has 2 ingredients (bread and butter) - The pudding might have bread and butter, plus flour, eggs and water - so thats 5 in total.</p>
  
  <p>My problem is, structuring an SQL query based on what ingredients are provided in a search. If I submit 3 ingredients in my search - bread, butter and eggs - then (from the 2 recipes discussed) only one result should be produced - Toast! - because there aren't enough ingredients to make the pudding!</p>
  
  <p>So what does such a sql query actually look like? I have tried everything, googled everything and now my brain cannot deal with it anymore.</p>