title: PHP : Don't show duplicated MySQL query results
body: <p>maybe from the title its looks like this is a duplicated question, but I've checked all other question and no one is like mine, my problem is that I've a <code>mysql</code> query on <code>Codeigniter</code> like so :</p>
  
  <pre><code>    function getApplication($product_id){
        $this-&gt;db-&gt;from('tapplicationproduct')
                  -&gt;where('nProduct',$product_id)
                  -&gt;join('tapplication','tapplication.nApplication=tapplicationProduct.nApplication');
  
                $query = $this-&gt;db-&gt;get();
                $ret['rows'] = $query-&gt;result();
                $ret['number'] = $query-&gt;num_rows();
  
                return $ret;
      }
  </code></pre>
  
  <p>and here's the the view :</p>
  
  <pre><code>&lt;div class="col-md-3"&gt;              
      &lt;select name="manufact" onchange="this.form.submit()"&gt;
      &lt;option value="" selected="selected"&gt;Selectioner Constructeur&lt;/option&gt;
      &lt;?php
        foreach ($app as $row) {
        $ManName = $Product_model-&gt;getManName($row-&gt;nManufacturer);
        echo "&lt;option value='".$row-&gt;nSerie."'&gt;".$ManName."&lt;/option&gt;";
        }
      ?&gt;  
      &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The problem is that for some products I got duplicated entries :</p>
  
  <p><a href="https://i.stack.imgur.com/0w5Z6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0w5Z6.png" alt="Problem Demonstration"></a></p>
  
  <p>I've tried the mysql instruction <code>GROUP BY</code> to group the results but the problem is that I need all the <code>$row-&gt;nSerie</code> to filter the next section of the results.</p>
  
  <p>What I mean is that when a user clicks on the <code>Constructor</code> a second <code>Select</code> <strong>tag</strong> will appear with the <code>Series</code> of the relevant <code>Constructor</code></p>
  
  <p>I've done this but I can't figure out how to remove the duplicated entries and keep the ability to access their <code>$row-&gt;nSerie</code>
  I hope I can find some help about this problem, and thanks to every on in advance.</p>