In the following fragment of my code I make a query to a Mysql database and create a pdf page with Fpdf but when I show the index of my file it appears in white.Code:
$query = mysqli_prepare($con, "SELECT titulo_editado,texto_editado as contenido from texto_editado where id = ?");
mysqli_stmt_bind_param($query, "i",$id);
$query->execute();
mysqli_stmt_bind_result($query,$titulo_editado, $contenido);
$query ->store_result();
if ($query ->num_rows > 0) {
$mpdf->IndexEntry($titulo_editado);
$mpdf ->WriteHTML('<p><span style="background-color:#7f8c8d">Algo</span></p>');
while (mysqli_stmt_fetch($query)) {
$mpdf -> WriteHTML('<div>'.$contenido.'</div>');
}
}
$query -> close();
$mpdf->AddPage();
$mpdf->WriteHTML('<h2>Indice De Contenido</h2>',2);
$mpdf->InsertIndex();
$mpdf -> Output('Nombre.pdf', 'I');
This shows me very well the variable $contenido
in my pdf but the variable $titulo_editado
does not show it It should be noted that the variable just does not show it outside the indexEntry () method in any other part of the document if it does it