fpdf does not show me the data of some of my mysql queries

0

It is as it says the title, in my PDF I make three queries and two of them do not show them, I do not see anything but does not show any error, the queries that show nothing are records 1 and records 2. I do not understand because this happens so I come to your help. I leave the code in question:

session_start();
include('../../php/conexion.php');
include('../../pdf/fpdf.php');
if (isset($_COOKIE["id_cliente"])) {
    $_SESSION["id_cliente"]=$_COOKIE["id_cliente"];
}

if (isset($_SESSION["id_cliente"]) && isset($_GET["pedido"])) {

$registros1=mysqli_query($conexion,"SELECT pedido,producto,cantidad,precio_producto FROM pedidos WHERE pedido='$_GET[pedido]'");
$registros2=mysqli_query($conexion,"SELECT * FROM pedidos2 WHERE pedido='$_GET[pedido]'");
$fila2=mysqli_fetch_array($registros2);
$registros3=mysqli_query($conexion,"SELECT nombre,apellido,direccion,codigoPostal,provincia FROM clientes WHERE id_cliente='$_SESSION[id_cliente]'");
$fila3=mysqli_fetch_array($registros3);


$pdf=new FPDF("P","pt","A4");
$pdf->AddPage();

$pdf->SetXY(30,210);
$pdf->SetFont("Times","",12);
$pdf->SetTextColor(0,0,0);
$pdf->Cell(280,13,utf8_encode($fila3["nombre"])." ".utf8_encode($fila3["apellido"]),0,0,"L");
$pdf->SetTextColor(0,102,255);
$pdf->SetFont("Times","B",12);
$pdf->Cell(95,13,"Numero Factura:",0,0,"L");
$pdf->SetTextColor(0,0,0);
$pdf->SetFont("Times","",12);
$pdf->Cell(0,13,$fila2["pedido"],0,1,"L");

while ($fila1=mysqli_fetch_array($registros1)) {
    $pdf->SetX(30);
    $pdf->SetFont("Times","",9);
    $pdf->SetTextColor(0,0,0);
    $pdf->Cell(60,30,$fila1["cantidad"],1,0,"C");
    $pdf->Cell(270,30,$fila1["producto"],1,0,"C");
    $pdf->Cell(105,30,$fila1["precio_producto"],1,0,"C");
    $pdf->Cell(105,30,($fila1["cantidad"]*$fila1["precio_producto"]),1,1,"C");
}

$pdf->Output("factura.pdf","I");
    
asked by jmz 23.06.2018 в 19:27
source

0 answers