Mysql
 sql >> Database >  >> RDS >> Mysql

PHP MySQL:aggiunta di una riga nel mezzo di un ciclo

Certo che è possibile. Tuttavia, non hai fornito il tuo codice, quindi ti darò lo pseudocodice.

writeheader();
$team = $data[0]['team'];
$count = 0;
foreach($data as $row){
 $count += 1;
 //if the current row's team is different than previous than add seperator
 if($row['team'] != $team){
   $team = $row['team'];
   writeseperator();
   writetotal($count);
   $count = 0;
 }
 writerow();
}