I have two table s that i am joining together as follows
<?php
$userqry="
SELECT *
FROM permission_category c
JOIN permission_group g
ON c.perm_group_id = g.id
";
$stmt = $conn2->prepare($userqry);
$stmt->execute();
while($row= $stmt->fetch()){
} ?>
<tr>
<td><?php echo $row['name'];?></td>
<td><?php echo $row['perm_group_name'];?>
</td>
<td>
</tr>
<?php } ?>
But The results am looking for should display as follows
How can i achieve this?

