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 mysql query on Codeigniter like so :
function getApplication($product_id){
$this->db->from('tapplicationproduct')
->where('nProduct',$product_id)
->join('tapplication','tapplication.nApplication=tapplicationProduct.nApplication');
$query = $this->db->get();
$ret['rows'] = $query->result();
$ret['number'] = $query->num_rows();
return $ret;
}
and here's the the view :
<div class="col-md-3">
<select name="manufact" onchange="this.form.submit()">
<option value="" selected="selected">Selectioner Constructeur</option>
<?php
foreach ($app as $row) {
$ManName = $Product_model->getManName($row->nManufacturer);
echo "<option value='".$row->nSerie."'>".$ManName."</option>";
}
?>
</select>
</div>
The problem is that for some products I got duplicated entries :
I've tried the mysql instruction GROUP BY to group the results but the problem is that I need all the $row->nSerie to filter the next section of the results.
What I mean is that when a user clicks on the Constructor a second Select tag will appear with the Series of the relevant Constructor
I've done this but I can't figure out how to remove the duplicated entries and keep the ability to access their $row->nSerie
I hope I can find some help about this problem, and thanks to every on in advance.

DISTINCTto get unique data.nSerievalue, then you actually do need to display every one. I would suggest selecting a different column to add to the text portion of the<option>to disambiguate the records.