$query = "SELECT category,name,brand,count,price,count*price,unit FROM goods order by category"; $result = mysqli_query ($conn, $query) or die ('Error'); if($result) { $rows = mysqli_num_rows($result); echo "<table border='3' bgcolor='#696969'><tr><td>Category</td><td>Name</td><td>Brand</td><td>Count</td><td>Price</td><td>Summary price</td><td>Unit tovar</td></tr>"; for ($i = 0 ; $i < $rows ; ++$i) { $row = mysqli_fetch_row($result); echo "<tr>"; for ($j = 0 ; $j < 7 ; ++$j) echo "<td>$row[$j]</td>"; echo "</tr>"; } echo "</table>"; mysqli_free_result($result); } It is necessary to replace the duplicate values of category with a blank value when the table is displayed.
