我正在打印此表
但我拥有的是这个
Ave和百分比应低于(考试,实验室,测验和背诵)标准
到目前为止,这是我的代码:
$sql_criteria = mysql_query("
SELECT DISTINCT criteria,
percentage
FROM tb_equivalent
WHERE instructor_id = '$inst_id'
AND description = '$desc'
AND subj_code = '$code'
AND term = '$term'
");
$criteria = array();
while ($row = mysql_fetch_assoc($sql_criteria)) {
$criteria[] = $row['criteria'];
$pdf->SetFont('Arial','',9);
$pdf->Cell(35,5,$row['criteria'],1,'','C');
$pdf->Cell(17.5,5,'Ave',1,'','C');
$pdf->Cell(17.5,5,$row['percentage']."%",1,'','C');
}
$pdf->Cell(35,10,'Grade',1,0,'C');
$pdf->Cell(35,10,'Remark',1,0,'C');
对我的问题的任何帮助将不胜感激,并且请...提前感谢我的代码中指出错误
答案 0 :(得分:0)
while($row = mysql_fetch_assoc($sql_criteria)){
$criteria[] = $row['criteria'];
$pdf->SetFont('Arial','',9);
$pdf->Cell(35,5,$row['criteria'],1,'','C');
$x = $pdf->GetX(); // get current x pos
$y = $pdf->GetY(); // get current y pos
$pdf->SetXY($x-35, $y+5); // move pointer back to start of and under criteria cell
$pdf->Cell(17.5,5,'Ave',1,'','C');
$pdf->Cell(17.5,5,$row['percentage']."%",1,'','C');
$pdf->SetXY($x, $y); // set pointer back to end of criteria cell
}