title: Trying to gather my ingredients to a recipe in my MySQL
body: <p>I am attempting to allow multiple ingredients to a recipe which I can figure out, but I want to collect all the ingredients to a recipe, if you are checking out an item that can be used in an ingredient. I hope that makes sense.</p>
  
  <p>create_id in recipe_rel is to find what item which recipe should create.</p>
  
  <pre><code>recipes Table                               recipe_rel table
  
  Recipe_id | item_needed_id | item_amount    recipe_id | create_id
  -----------------------------------------   ---------------------
      1     |      5         |      3              1    |    12
  -----------------------------------------   ---------------------
      1     |      2         |      2              2    |    18
  -----------------------------------------   ---------------------
      2     |      8         |      1
  -----------------------------------------
      2     |      3         |      1
  </code></pre>
  
  <p>So to clarify my problem, an item could be coal - so if i were to view coul, i'd like to see what i can create with coal.</p>
  
  <p>I've tried to do something similar</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM recipe WHERE item_needed_id = 2
  </code></pre>
  
  <p>I also tried just getting the recipe id from the one i am picking at and use that but that seems to be alot of hardcoding, this is for a PHP page.</p>
  
  <p>But I can't figure out on my own what I should write to get both ingredients in that, because right now I only get the row that has item needed id 2</p>
  
  <p>My result should be getting all with recipe_id = 1 and also include if there should be a case where an item also uses (in this example) coal, should be listed on coal viewing page.</p>
  
  <p>Like if coal can be used to create X and Y
  You'd see full ingredients to X and Y on the Coal viewing page</p>
  
  <p>I hope that make sense. Thank you.</p>