hi friends..
i have problem with my report pdf
my php code is here
<?php
define('FPDF_FONTPATH','Template/includes/font/');
require('Template/includes/fpdf.php');
include('Template/includes/common.inc.php');
class PDF extends FPDF
{
//Load data
function LoadData($classID)
{
//Read data from table
$ResultAllClass=QrySelect("SELECT distinct new_sm_examid_issue.exam_id,sm_studentmaster.stu_id ,sm_studentmaster.stu_name, sm_studentmaster.stu_dob,sm_studentmaster.stu_state,sm_studentmaster.stu_country,sm_studentmaster.stu_residentphone
from sm_studentmaster,new_sm_examid_issue
WHERE sm_studentmaster.stu_id=new_sm_examid_issue.stu_id and sm_studentmaster.cls_id=new_sm_examid_issue.cls_id and sm_studentmaster.cls_id='$classID' ");
$datas=array();
while($class=mysql_fetch_row($ResultAllClass))
{
$datas[]=$class;
}
mysql_free_result($ResultAllClass);
return $datas;
}
//Simple table
function BasicTable($header,$data)
{
//Header
foreach($header as $col)
{
$this->Cell(28,7,$col,1);
}
$this->Ln();
//Data
foreach($data as $row)
{
foreach($row as $col)
$this->Cell(28,7,$col,1);
$this->Ln();
}
}
}
$pdf=new PDF();
//Column titles
$header=array('ExamId','StudentId','StudentName','DOB','State','Country','Phone Number');
// Row data
$vals = $_GET['test'];
$data=$pdf->LoadData($vals);
$pdf->SetFont('Arial','B',10);
$pdf->AddPage();
$pdf->BasicTable($header,$data);
$pdf->Output();
?>
when i am including
include('Template/includes/common.inc.php');
produce one error..
FPDF error: Some data has already been output to browser, can't send PDF file
i need to display the data in the pdf from the database.
so i need the corresponding query.
for writing the sql query i need to include that common.inc.php file
how can i overcome this problem... anyone help me...
a v vishnu