Как мне распечатать все строки из таблицы, используя fpdf. Пока что я могу напечатать только одну запись вместо всей таблицы, пример кода приведен ниже. Этот код выводит одну строку. Я хочу, чтобы все строки таблицы.
$query=mysqli_query($conn,"SELECT sells.client_id,sells.pro_id, sells.name, sells.email, sells.contact, sells.card_number, sells.address, sells.status, property.price, sells.date
FROM sells LEFT JOIN property ON sells.pro_id = property.pro_id WHERE sells.client_id = '63662' ") or die('Error Printing reciept');
while($row = mysqli_fetch_array($query)){
$email = $row['email'];
$name = $row['name'];
$contact = $row['contact'];
$address = $row['address'];
$price = $row['price'];
$pro_id = $row['pro_id'];
$status = $row['status'];
$date = $row['date'];
$card_number = $row['card_number'];
//Printing of payment reciept to pdf
$pdf = new FPDF('p', 'mm', 'A4');
$pdf->AddPage();
$pdf->SetFont('Courier','',8);
//$pdf->Image("image/logo.png", 20,20,15,15);
$pdf->Ln(7);
$pdf->Cell(180,20,'PROPERTY PURCHASES', 0, 1, "C");
$pdf->Cell(170,2,'------------------------------------------------------------------', 0, 0);
$pdf->Ln(8);//New line
$pdf->Cell(50,8,'Property Number: ', 1, 1);
$pdf->Cell(50,8," {$pro_id}", 1, 1, "L");
$pdf->Cell(50,8,'Client Names: ', 1, 1);
$pdf->Cell(50,8," {$name}", 11, 1, "L");
$pdf->Cell(50,8,'Client Contact: ', 1, 1);
$pdf->Cell(50,8," {$contact}", 1, 1, "L");
$pdf->Cell(50,8,'Client Email: ', 1, 1);
$pdf->Cell(50,8," {$email}", 1, 1, "L");
$pdf->Cell(50,8,'Client NRC/Passport Num: ', 1, 1);
$pdf->Cell(50,8," {$card_number}", 1, 1, "L");
$pdf->Cell(50,8,'Client Address: ', 1, 1);
$pdf->Cell(50,8," {$address}", 1, 1, "L");
$pdf->Cell(50,8,'Property Price: ', 1, 1);
$pdf->Cell(50,8," ZMK {$price}", 1, 1, "L");
$pdf->Cell(50,8,'Request Date: ', 1, 1);
$pdf->Cell(50,8," {$date}", 1, 1, "L");
$pdf->Ln(2);
$pdf->Cell(170,10,'------------------------------------------------------------------', 0, 0);
$pdf->Ln(2);//New line
$pdf->Cell(180,20,'Thankyou! print and produce the reciept to a RTSA official.', 0, 1, "C");
$pdf->Output();
}
?>