I have the database of DATA created in this format.
the code you use for the query is the following: only that the class table increases The column Bimester to demilitar the query.
<table class="table table-bordered table-striped table-hover">
<tbody>
<tr>
<td>N°</td>
<td class="warning"><H3>APELLIDOS Y NOMBRES</H3></td>
<?php
$consulta="SELECT * FROM clase WHERE bimestre='1BIM'";
$resultado=$link->query($consulta);
foreach ($resultado as $dia) {
echo "<td>".$dia['fecha']."</td>";
}// cierra el foreach
echo "</tr>";
$tabla1="alumno";
$tabla2="lista";
$tabla3="clase";
$consultax="SELECT $tabla1.id,$tabla1.ap,$tabla1.am,$tabla1.nom,$tabla2.alumno_id,$tabla2.clase_id,$tabla2.estado FROM $tabla1,$tabla2 WHERE $tabla1.id=$tabla2.alumno_id ";
$resultadox=$link->query($consultax);
while ($row=$resultadox->fetch_array()) {
$ap=$row['ap'];
$am=$row['am'];
$nom=$row['nom'];
$id=$row['id'];
$estado=$row['estado'];
echo "<tr>";
echo"<td>".$id."</td>";
echo "<td>".$ap." ".$am." ".$nom."</td>";
echo "<td>".$estado."</td>";
echo "</tr>";
}
?>
</tbody>
</table>
the final result would have to be like this:
in advance I would appreciate your help.