title: How to select all field from table with distinct (field x) ?? Codeigniter
body: <p>I try this code </p>
  
  <pre><code>function catstore($id)
      {   
          $this-&gt;db-&gt;distinct();
          $this-&gt;db-&gt;select('store_id');
          $this-&gt;db-&gt;from('products');
          //$this-&gt;db-&gt;join('products','products.store_id = products.store_id');
          $this-&gt;db-&gt;where('cat_id', $id);
          $result = $this-&gt;db-&gt;get();
          return $result-&gt;result();       
      }
  </code></pre>
  
  <p>it produces only the distinct store_id but i want all column of the table with distinct rows based on store_id</p>
  
  <p>Suggest me any option</p>
  
  <p>Thanks in advance</p>