mySQL和PHP从数据库中过滤$ _GET结果

My code receives a brand from an html form, it then proceeds to generate the search results from the database.

      if(isset($_GET['brand'])) {
    $brand = mysqli_real_escape_string($db, $_GET['brand']);
    echo $brand;

    $featuredSql = "SELECT t.*, s.quantity, s.rrp AS nRetailPrice, r.city AS city_name, ts.thumbnail as tread_thumbnail, ts.bigpic as tread_bigpic, t.rating FROM tyres t INNER JOIN stocklevels s 
ON t.stockcode=s.stockcode LEFT JOIN tyre_treads ts ON t.treadid=ts.recid LEFT JOIN reseller r ON s.city=r.recid WHERE s.quantity>0 ";


    if ($brand != 'Any') $featuredSql .= " AND t.manufacturer='$brand'";
    $featuredSql .= "GROUP BY t.diam,t.manufacturer, t.width";
    if (!$featured = mysqli_query($db, $featuredSql)) die(mysqli_error());
    var_dump($featured);
    if (!$tyre1 = mysqli_fetch_object($featured)) echo "<br />No tyres match those parameters. Please try again.";
}

The HTML to represent the data once collected.

 <div class="text text-background">
 <h4>
     <a href="detail.php"><?= $product["profile"] . "/" . $product["width"] . "/" . $product["diam"] . " " . $product['manufacturer']; ?></a>
 </h4>
     <p class="brand"><a href="#"><?= $product["part_no"]; ?></a></p>
     <div class="col-md-12 col-sm-12 col-xs-12 text-right">
        <div class="txtprice-small">PRICE FROM $<span><?= $product["nRetailPrice"]; ?></span></div>
     </div>
     <table class="table table-condensed small">
        <tbody>
           <tr>
              <td width="40%">SIZE:</td>
              <td width="60%"><?= $product["diam"]; ?></td>
           </tr>
           <tr>
              <td>Width:</td>
              <td><?= $product["width"]; ?></td>
           </tr>
           <tr>
              <td>Profile:</td>
              <td><?= $product["profile"]; ?></td>
           </tr>
           <tr>
              <td>Stock:</td>
              <td><?= $product["quantity"]; ?></td>
           </tr>
           <tr>
              <td>Rating:</td>
              <td><?= $product["rating"] ?></td>
           </tr>
        </tbody>
    </table>


        if ($brand != 'Any') $featuredSql .= " AND t.manufacturer='$brand'";
        $featuredSql .= "GROUP BY t.diam,t.manufacturer, t.width";
        if (!$featured = mysqli_query($db, $featuredSql)) die(mysqli_error());
        var_dump($featured);
        if (!$tyre1 = mysqli_fetch_object($featured)) echo "<br />No tyres match those parameters. Please try again.";
    }

Now the problem is the database is poorly maintained and several items are duplicates (hence the GROUP BY diam, manufacturer and width) but each of those items has its own stock, eg

Item part_no abc stock 5, Item part_no abc stock 7

so there are actually 12, but are both listed as separate items,the GROUP_BY groups them together, but doesn't do anything with the stock level.

My question is how should I handle this? I've looked at trying to use COUNT in the original Query, but the while loop with the fetch assoc breaks if I do that. Although I could have coded it incorrectly (fairly new to PHP and using MySQL). I could also GROUP BY part_no but this doesn't seem to help either.

Additional Information as recommended

Tyre's Database RecID is Unique Primary Key part_no Not Unique stockCode IS UNIQUE

Sample Data

    \/65\/14-4015","thumbnail":null,"bigpic":null,"rating":"82H","tread":null,"profile":"65","width":"175","diam":"14","description":null,"rrp":"0.00","flag":null,"notes":"","treadid":"707","hide":"no","quantity":"1","nRetailPrice":"79.00","city_name":"New Plymouth","tread_thumbnail":"707_thumb.jpg","tread_bigpic":"707_large.jpg"},

{"recid":"3705","part_no":"ALT185\/65\/14","manufacturer":"ALTENZO","supplier":null,"stockcode":"TY-ALT185\/65\/14-3705","thumbnail":null,"bigpic":null,"rating":"86H","tread":null,"profile":"65","width":"185","diam":"14","description":null,"rrp":"0.00","flag":null,"notes":"","treadid":"707","hide":"no","quantity":"1","nRetailPrice":"79.00","city_name":"Palmerston North","tread_thumbnail":"707_thumb.jpg","tread_bigpic":"707_large.jpg"},

{"recid":"4557","part_no":"ALT185\/60\/15","manufacturer":"Altenzo","supplier":null,"stockcode":"TY-ALT185\/60\/15-4557","thumbnail":null,"bigpic":null,"rating":"88H","tread":null,"profile":"60","width":"185","diam":"15","description":null,"rrp":"0.00","flag":null,"notes":"","treadid":"707","hide":"no","quantity":"2","nRetailPrice":"99.00","city_name":"Petone","tread_thumbnail":"707_thumb.jpg","tread_bigpic":"707_large.jpg"},

{"recid":"2827","part_no":"ALT195\/50\/15","manufacturer":"ALTENZO","supplier":null,"stockcode":"TY-ALT195