I have to get all results and push to HTML table, but existing rows have to be combine to 1 row.
This is my table
id domain php_version
-----------------------------
1 localhost 5.5.30
2 live 7.05
3 localhost 5.5.30
4 localhost 5.5.30
and the code which output the html table is:
// Prepare query
$stmt = $mysqli->prepare("SELECT * FROM domains ORDER BY domain ASC LIMIT 10");
// Execute the query
$stmt->execute();
// Bind Parameters
$stmt->bind_result($id, $domain, $php_version);
<?php while ($stmt->fetch()) : ?>
<tr class="row-id-<?php echo $id; ?>">
<td class="id"><?php echo $id; ?></td>
<td class="domain"><?php echo $domain; ?></td>
<td class="php_version"><?php echo $php_version; ?></td>
</tr>
<?php endwhile; ?>
The output looks like this:
And I just want to be like this:
I just want to combine values of dublicated domains in one row/column
Thank you very much!