Be careful, those are not duplicate records. And you do not want to remove anything. I think what you probably mean is that you have a GROUP BY query and you want to display a Group Header of the data so that it is displayed once, at the beginning of a group of records, rather than repeated for every record.
Assuming that that's what you mean, it's done by storing the value of the Group By field(s) in a variable, then as you cycle through the records, test each one to see if its group by field(s) is/are different from the previously stored value. Only display that information when it is different from the previous (and store it in the variable, so you can test the next record). It should look something like this:
Code: Select all
$lasthdr="";
while($list=mysqli_fetch_assoc($result)) {
extract($list);
$hdr=$gm_date . $gm_time . $ref_lname;
if($hdr != $lasthdr) {
echo "<tr><td>$gm_date</td><td>$gm_time</td><td>$ref_lname</td>";
$lasthdr=$hdr;
} else {
echo "<tr><td colspan='3'>";
)
echo "<td>$gameid</td><td>$fld_name</td><td>$team_name</td></tr>";
}
At least, that's the way I'd do it.