title: How to convert and fix this query for codeigniter?
body: <p>I have this MYSQL query:</p>
  
  <pre><code>SELECT * 
  FROM store_product 
  LEFT JOIN store_promo_product ON store_product.store_product_id = store_promo_product.store_product_id
  LEFT JOIN store_promo ON store_promo.store_promo_id = store_promo_product.store_promo_id 
  JOIN product ON product.product_id = store_product.product_id
  WHERE store_product.store_id = 338 and store_promo_product.store_product_id=52
  </code></pre>
  
  <p>While i know how to convert it to <strong><code>codeigniter</code></strong> Active Record using Join syntax, the problem is that sometimes i can have few <code>"store_product_id"</code> from the same store so the query will return the product details + promo details twice or more (depends how much promos i have for the same product). I am looking for away to return only ONE product (because it is the same product) with two promos (because they are different promo sales) ..</p>
  
  <p>Hope i explained my self.
  even pure <code>mysql</code> will do if possible of course.</p>