I am trying to combine two foreach()
loop values into an array and display it in a single table. Both of them have the same field, but how can i display it in a single table instead of having two different tables?
<tr>
<th> ID </th>
<th> Transaction Type </th>
</tr>
<tbody>
<?php
$ch = new CommissionHelper($rep);
$data = $ch->getTransactionRecords($member);
foreach ($data as $record ) {
$d = ((object)$record);
$pt = round($d->point, 2);
?>
<tr>
<td><?php echo $d->id;?></td>
<td><?php echo $d->type;?></td>
</tr>
<?php
}
?>
</tbody>
<tr>
<th> ID </th>
<th> Transaction Type </th>
</tr>
<tbody>
<?php
$query = "SELECT * FROM invoice_withdraw_debit_card where user_ID like $id";
$data = $MySQLi_CON->query($query);
foreach ($data as $key ) {
?>
<tr>
<td><?php echo $key['invoice_ID'];?></td>
<td><?php echo $key['type'];?></td>
</tr>
<?php
}
?>
</tbody>