I have this error fetching MySql table to PDF using FPDF.
It shows only 3 columns in portrait format where I am passing general query which should display all the columns.
I need an expert advice that how to resolve this.
My code is:
<?php
require_once("dbcontroller.php");
$db_handle = new DBController();
$result = $db_handle->runQuery("SELECT * FROM icard");
$header = $db_handle->runQuery("SELECT `COLUMN_NAME` FROM
`INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='blog_samples' AND
`TABLE_NAME`='icard'");
require('fpdf/fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',12);
foreach($header as $heading) {
foreach($heading as $column_heading)
$pdf->Cell(90,12,$column_heading,1);
}
foreach($result as $row) {
$pdf->SetFont('Arial','',12);
$pdf->Ln();
foreach($row as $column)
$pdf->Cell(90,12,$column,1);
}
$pdf->Output();
?>
When I am running this script, it only fetches 3 columns. I have 10 columns which need to be fetched - how can I do it?
If you have any idea then help me