title: MySQL Inner Join Query Multiple Tables
body: <p>I am trying to join up a few tables and examples of the layouts are below:</p>
  
  <p>orders</p>
  
  <pre><code>user_id=7 pricing id=37
  </code></pre>
  
  <p>products_pricing</p>
  
  <pre><code>id=37 product_id=33
  </code></pre>
  
  <p>products </p>
  
  <pre><code>id=33 name=test product
  </code></pre>
  
  <p>SQL</p>
  
  <pre><code>SELECT *
  FROM orders
    INNER JOIN products_pricing
      ON orders.pricing_id = products_pricing.id
    INNER JOIN products
      ON products_pricing.product_id = products.id
  WHERE orders.user_id = '7' ");
  </code></pre>
  
  <p>listings</p>
  
  <pre><code>id=233 user_id=7 url=test.com
  </code></pre>
  
  <p>With this SQL i get an output giving me all the products from the user_id of 7 and it will list each products name in a while loop. However when I add another INNER JOIN  for a table called listings, which has a user_id column and I need to grab a url for each row that matches so I can hyperlink the product names with the url I get everything contained in the listings table as well as the working stuff above. I'm either doing it very wrong or am missing something. I've spent a few hours trying to figure it out but keep getting the same result. Can anyone help me out?</p>