title: MySQL get data from three tables using one id
body: <p>I have three different tables, which have following structure:</p>
  
  <h3>Food</h3>
  
  <pre><code>ID | title
  ---+----------
  1  | sandwich
  2  | spaghetti
  </code></pre>
  
  <h3>Ingridients</h3>
  
  <pre><code>ID  | food_reference | type | location | bought
  ----+----------------+------+----------+----------
  100 | 1              | ham  | storeA   | 11-1-2013
  101 | 1              | jam  | storeB   | 11-1-2013
  102 | 2              | tuna | storeB   | 11-6-2013
  </code></pre>
  
  <h3>Tags</h3>
  
  <pre><code>ID  | food_reference | tag 
  ----+----------------+-----
  1000| 1              | Tag
  1001| 1              | Tag2  
  1002| 2              | fish 
  </code></pre>
  
  <p>and using one select I want to get all information from these three tables (title,type,location,bought,tag) for one specific ID.
  I have tried something like</p>
  
  <pre><code>SELECT food.*,ingridients.*,tags.* FROM food  
              JOIN ingridients
                  ON :id=ingridients.food_reference
              JOIN tags
                  ON :id=tags.food_reference
              WHERE id=:id
  </code></pre>
  
  <p>BUT this query returns for id=1 only one row from ingridients and tags even though there are two matching rows (ham and jam, Tag and Tag2). Could you tell me what am I doing wrong?</p>
  
  <p>EDIT: I tried LolCoder's solution, but I still got only one result, even though in fiddle it seems to work. However I tried  : </p>
  
  <pre><code> SELECT F.*, group_concat(I.type), group_concat(I.location), 
     group_concat(I.bought), group_concat(T.tag) 
   FROM feeds F 
   INNER JOIN ingridients I 
     ON :id = I.food_reference
   INNER JOIN tags T
     ON :id=T.food_reference
   WHERE F.id=:id 
  </code></pre>
  
  <p>This finds data from ALL matching rows, but several times, i.e. I get (for id=1)
   sandwich,ham,ham,ham,jam,jam,jam,tag,tag,tag,tag2,tag2,tag2</p>
  
  <p>EDIT2: magic happened and LolCoder's solution works, so thank you :-)</p>