I have the following requirement I need to associate all the data of common expenses of the month with each user, besides that if you have not common expenses these are individual associate in a td to that user, and in the end it shows how much you owe here is the first table
Then you have to check this second one in case there is any other expense
for after associating this sum it is shown in the user in the last td that says the amount
here the users table
my progress so far is to show the expenses but I still can not associate to leave each user with a td associated with the expenses and their amount this is the code
<table>
<tr>
<th>Propietario</th>
<th>Descripcion de gastos</th>
<th>total a pagar</th>
</tr>
<?php
include 'conexion.php';
$sql = "SELECT descripcion,monto,factura,create_at FROM gasto_g";
$res = mysqli_query($conexion,$sql);
while (list($descripcion,$monto,$factura,$create_at)=mysqli_fetch_array($res)) {
echo " <tr>\n" .
" <td></a></td>\n" .
" <td>$descripcion</a></td>\n" .
" <td>$monto</td>\n" .
" </tr>\n";
}
?>
</table>
What I expect is something like this, noting that the 2nd user has an individual expense that does not correspond to another