I'm receiving the following error "Parse error: syntax error, unexpected 'while' (T_WHILE), expecting ')' in /Applications/XAMPP/xamppfiles/htdocs/website-proiecte.dataserv.ro/includes/printAnexa2.inc.php on line 46".
Cannot figure where the error is. Here is also the code:
<?php
require_once ('../vendor/autoload.php');
require_once ('dbh.inc.php');
$mpdf = new \Mpdf\Mpdf(['tempDir' => __DIR__ . '../tmp']);
if(isset($_GET['report-id']))
{
$id = $_GET['report-id'];
$sql = "SELECT * FROM planning
inner join classes on classes.classesClass = planning.planningClass
WHERE planningId = '$id'
";
$result = mysqli_query($conn, $sql);
// raport anexa 2
$mpdf->AddPage('P');
$mpdf->WriteHTML('
<img src="../img/ue-logo.jpg" height="60" width="auto" />
<img style="padding-left: 32%;" src="../img/gr-logo.jpg" height="60" width="auto" />
<img style="padding-left: 32%;" src="../img/is-logo.jpg" height="60" width="auto" />
<br /><br />
<p style="text-align: right; padding-right: 5%;"><strong>ANEXA 2</strong></p>
<br />
<h3 style="text-align: center;">GRAFIC INSTRUIRE PRACTICĂ</h3>
<br /><br /><br /><br /><br />
<table style="border:1px solid black; width:100%;">
<tr>
<th>Clasa</th>
<th>Saptamana</th>
<th>Data Start</th>
<th>Data Finalizare</th>
<th>Ora incepere</th>
<th>Ora terminare</th>
</tr>
<tr>'
while($fetch = mysqli_fetch_array($result)) {'
<td>' . $fetch['planningClass'] . '</td>
<td>' . $fetch['planningWeek'] . '</td>
<td>' . $fetch['planningDateStart'] .'</td>
<td>' . $fetch['planningDateEnd'] . '</td>
<td>' . $fetch['planningHourStart'] .'</td>
<td>' . $fetch['planningHourEnd'] . '</td>
</tr>
</table> ' } '
');
}
$mpdf->Output();