I want to make a pdf file in php. I write code like this:
<?php
require_once __DIR__ . '/vendor/autoload.php';
include('conn.php');
$res = mysqli_query($conn, "select * from smash");
if (mysqli_num_rows($res) > 0) {
$html = '<table>';
$html = '<tr><td>ID</td><td>Name</td><td>FatherName</td><td>Address</td><td>Phone</td><td>Class</td><td>Qualification</td><td>Branch</td><td>rollno</td></tr>';
while ($row = mysqli_fetch_assoc($res)) {
$html .= '<tr><td>' . $row['id'] . '</td><td>' . $row['name'] . '</td><td>' . $row['fname'] . '</td>
<td>' . $row['address'] . '</td><td>' . $row['phone'] . '</td><td>' . $row['class'] . '</td>
<td>' . $row['qualification'] . '</td><td>' . $row['branch'] . '</td>
<td>' . $row['rollno'] . '</td><td>' . $row['gender'] . '</td>
<td>' . $row['birth'] . '</td></tr>'
}
$html= '</table>';
{
$html = "Data not found"
}};
$mpdf = new mPDF();
$mpdf->WriteHTML($html);
$file = time() . '.pdf';
$mpdf->output($file, 'D');
But a error show: Parse error: syntax error, unexpected token "}" in C:\xampp\htdocs\Management\printstudentdata.php on line 15
I use PHp 8.