Right, I've put something together. I don't know if it does what you want, but it outputs a table of 3 columns (merchants, issues and updates) and should output roughly thesame as you have in your picture.
PHP Code:
// Set merchant, issue and update value to blank.
$merchant = "";
$issue = "";
$update = "";
// Start display
$display = "<table>
<tr>
<th>Merchants</th>
<th>Issues</th>
<th>Updates</th>
</tr>";
// Loop through all the results in the MySQLi $result set. You'll obviously have to
// load it with $result = $mysqli->query($sql) or something first.
while($r = $result->fetch_array()) {
// Start each result on a new row
$display .= "<tr>";
// If the merchant name is not thesame as the last one,
// set $merchant to this merchant name and fill cell with
// name and other details. Otherwise, just echo empty cell.
if($r['merchant_name'] != $merchant) {
$merchant = $r['merchant_name'];
$display .= "<td>$r['merchant_name']<br />$r['merchant_phone']</td>";
} else {
$display .= "<td> </td>";
}
// If the issue name is not thesame as the last one,
// set $issue to this issues name and fill cell with
// name. Otherwise, just echo empty cell.
if($r['issue_name'] != $issue) {
$issue = $r['issue_name'];
$display .= "<td> </td><td>$r['issue_name']</td>";
} else {
$display .= "<td> </td>";
}
// Update is always displayed in each row if exists.
$display .= "<td>$r['update_name']</td></tr>";
}
$display .= "</table>";
Hope it's a bit of help
Regards,
Martin