我正在处理 fpdf,我想创建框并在不同的框中显示数据库中的每个数据。就像我有 2 个具有不同 XY 尺寸的框,所以我想在第一个框中显示值 1,在第二个框中显示值 2,但问题是当我使用我的代码时,它在两个框中都显示了值 1 和 2。我的代码是
$w = array(82,95); //for XY dimension
for($i=0;$i<2;$i++)
{
$reusult1 = $GLOBALS['conn']->query($sql2);
$queryresult=mysqli_num_rows($reusult1);
$this->Rect($w[$i], 47.5, 13, 9);
$this->SetXY($w[$i] , 47.5);
$this->SetFont( "Arial", "", 9);
while($rows = mysqli_fetch_assoc($reusult1)){
$this->Cell(4,4,$rows['position'],1,0,'C');
}
}
在$rows['position']有值1和2。
慕桂英3389331