php kez her türüne göre grup ile mysql verilerini görüntülemek için nasıl

1 Cevap php

Ben böyle ayarlanmış bir sonuç var:

Platform   Set   Total
WinY1-23   OT    12
WinY1-23   TT    22
WinY1-23   OR    13
WinY1-23   OY    142
Total_WS   OT    12
Total_WS   TT    12
Total_WS   OR    13

Basically this is a query with group by Platform, Set. I want to be able to display each Set and its total within each Platform. Hope this makes sense. Is there any way to display just once the Platform and the Sets under it? In SSRS we can show something similar , as the report displays + sign for each of this Platform type. Can we do this in PHP? or by any other means?

Teşekkürler.

1 Cevap

Ne istediğinizi Asssuming bu gibi bir şeydir:

$platform = '';
foreach($resultSetArray as $row){
  // if platform is different from previous one
  // display platform
  if($row['platform'] != $platform){
    echo $row['platform'];
    $platform = $row['platform'];
  }

  echo $row['otherStuff'];
}


WinY1-23   
OT    12
TT    22
OR    13
OY    142
Total_WS
OT    12
TT    12
OR    13