Salve a tutti: ho ri e riprovato a creare un pdf con un'estrazione da Mysql con fpdf...

Pur ricambiando di sana pianta tutto sbaglio ancora...

Qualcuno sa dirmi dove?

codice:
<?php
require('../fpdf.php');
//Connect to your database
$host = '...';
$user = '...';
$password = '...';
$database = '...';
$db = mysql_connect($host,$user,$password) or die ("impossibile connettersi al server $host");

mysql_select_db($database, $db) or die ("impossibile connettersi al database $database");

$result=mysql_query("select * from tabella ORDER BY numero");




class PDF extends FPDF
{
//Load data
function LoadData($file)
{
	//Read file lines
	$lines=file($file);
	$data=array();
	foreach($lines as $line)
		$data[]=explode(';',chop($line));
	return $data;
}
function FancyTable($header,$data)
{
	//Colors, line width and bold font
	$this->SetFillColor(255,0,0);
	$this->SetTextColor(255);
	$this->SetDrawColor(128,0,0);
	$this->SetLineWidth(.3);
	$this->SetFont('','B');
	//Header
	$w=array(40,35,40,45);
	for($i=0;$i<count($header);$i++)
		$this->Cell($w[$i],7,$header[$i],1,0,'C',1);
	$this->Ln();
	//Color and font restoration
	$this->SetFillColor(224,235,255);
	$this->SetTextColor(0);
	$this->SetFont('');
	//Data
	$fill=0;
	foreach($data as $row)
	{
		$this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);
		$this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);
		$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);
		$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);
		$this->Ln();
		$fill=!$fill;
	}
	$this->Cell(array_sum($w),0,'','T');
}
}

$pdf=new PDF();
//Column titles
$header=array('Numero','Oggetto','Sezione','Data');
//Data loading
while($result = mysql_fetch_array($result,MYSQL_NUM))

{
$data=$pdf->LoadData($result['numero'], $result['oggetto'],$result['id']);
}
$pdf->SetFont('Arial','',14);
$pdf->AddPage();
$pdf->BasicTable($header,$data);
$pdf->AddPage();
$pdf->ImprovedTable($header,$data);
$pdf->AddPage();
$pdf->FancyTable($header,$data);
$pdf->Output();
?>