Good evening I hope and you can help me I have a query in mysql that displays the data in the following way
but I need the records to be this way
I'm doing the report with fpdf I have the following
$sql1 ="select a.estudiante_Carnet, b.PrimerNombre, b.PrimerApellido, a.Nota1
from notas a
inner join estudiante b
on a.estudiante_Carnet = b.Carnet
where b.grado_CodigoGrado='b3b'";
$res = mysqli_query($conexion,$sql1);
$row = mysqli_fetch_array($res);
$bandera = $row['b.Carnet'];
$pdf = new PDF();
//$pdf = new FPDF('P','mm',array(165,220));
$pdf->Addpage();
$pdf->AliasNbPages();
$pdf->SetFont('Arial','B',5);
$pdf->Ln(10);
$res2 = mysqli_query($conexion,$sql1);
$pdf->Cell(10,10, "hola",1,1,'C',0);
while ($fila = $res2->fetch_array())
{
if ( $bandera == $fila['b.Carnet'] ) {
$bandera = $fila['b.Carnet'];
$pdf->Cell(10,10, $fila['PrimerNombre'],1,0,'C',0);
$pdf->Cell(10,10, $fila['Nota1'],1,0,'C',0);
$pdf->Ln();
}
else {
////////////////////////////////////////////////////////////////////
$pdf->Addpage();
$bandera = $fila['b.Carnet'];
$pdf->Cell(10,10, $fila['PrimerNombre'],1,0,'C',0);
$pdf->Cell(10,10, $fila['Nota1'],1,0,'C',0);
$pdf->Ln();
}
}
$pdf->Output();
?>