Print several MultiCells in one line

0

The problem is that I get data from a mysql database with $tupla=mysqli_fetch_array($bloque); ($ block contains the result of the query), I must write each data in a different column of a pdf, use a for to scroll through all the results and write them all but I happen to write all the results in the same cell, not in different, as if all the information was in a single string.

I append the code I use, the first for prints the headings and the second for the results of each tuple.

$pdf = new FPDF('L','mm','Legal');
$pdf->AddPage();
for ($c=0; $c < $numeC; $c++){
    $campo=mysqli_fetch_field($bloque);
    $pdf->SetFont('Arial','B',10);
    $pdf->Cell(30,10,$campo->name);
}

$pdf->Ln();
$pdf->SetFont('Courier','I',8);
$numeF= mysqli_num_rows($bloque); 

for ($r=0; $r < $numeF; $r++) {
    $tupla=mysqli_fetch_array($bloque);
    for ($c=0; $c<$numeC; $c++){
        $pdf->MultiCell(28.5,3,$tupla[$c]); // Aqui esta el problema, ya intente con Cell(), Write() y Text()
    }
$pdf->Ln();
}

If I print them with echo $tupla[$c] if you throw the results at me, the problem is when you pass them to the PDF. I hope you can help me, thanks.

    
asked by Arturo Robles 09.08.2018 в 04:58
source

0 answers