include_once( 'dompdf\dompdf_config.inc.php');
$html = '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="container">
<caption><h2 style="margin-left: 180px;">St. Therese Lisioux School of Cainta </h2></caption>
<table class="zebra">
$thissubject = $_POST['subject'];
$thissection = $_POST['section'];
$thisgrade_level = $_POST['grade_level'];
$sqlQuery = mysql_query("SELECT si.STUDENT_ID, concat(si.LNAME,', ',si.FNAME) as Name,
sg.*
From student_info si Left join grades sg On si.STUDENT_ID = sg.STUDENT_NO
WHERE SECTION = '$.thissection'");
while($row = mysql_fetch_assoc($sqlQuery))
{
$student_id = $row['STUDENT_NO'];
$Name = $row['Name'];
$SUBJECT_NAME = $row['SUBJECT'];
$first_Grading = $row['FIRST_GRADING'];
$second_Grading = $row['SECOND_GRADING'];
$third_Grading = $row['THIRD_GRADING'];
$fourth_Grading =$row['FOURTH_GRADING'];
$final = $row['FINAL'];
$status = $row['STATUS'];
$html .= '<tbody>
<tr class="warning">
<td>'.$student_id.'</td>
<td>'.$Name.'</td>
<td>'.$SUBJECT_NAME.'</td>
<td>'.$first_Grading.'</td>
<td>'.$second_Grading.'</td>
<td>'.$third_Grading.'</td>
<td>'.$fourth_Grading.'</td>
<td>'.$final.'</td>
<td>'.$status.'</td>
</tr>
</tbody>';
}
$html .= ' </table>
</div>
</body>
</html>
';
$dompdf = new DOMPDF();
$dompdf ->set_paper("a4", "landscape");
$dompdf ->load_html($html);
$dompdf ->render();
$dompdf ->stream('Student_report.pdf');
?>strong text
答案 0 :(得分:1)
您的代码存在严重的PHP语法错误。