Salve a tutti,
ho creato un file pdf con FPDF che stampa la mia tabella mysql.
lo scritp funziona correttamente, fa il suo dovere.
Il problema nasce quando cancello, o inserisco un record nella tabella. Infatti quando lo faccio, e vado ad eseguire lo script che genera il pdf, apre quello precedente.
Se faccio F5, aggiornando il pdf, compare quello esatto.
Come posso evitare di aggiornarlo manualmente, e farlo tramite lo script?


il codice funzionante è questo
Codice PHP:
$connessione mysql_connect($db_host$db_user,$db_password) or die("Connessione fallita !"); 

@
mysql_select_db($db_name) or die("Selezione Database fallita !"); 



//Select the Products you want to show in your PDF file

$sql="SELECT * from UtentePrivato ";

$risultato_query=mysql_query($sql,$connessione) or die("Query fallita !".mysql_error()); 



$number_of_products mysql_numrows($risultato_query);



//Initialize the 3 columns and the total

$column_Cognome "";

$column_Nome "";

//$column_price = "";

//$total = 0;



//For each row, add the field to the corresponding column

$i=0;

while(
$riga mysql_fetch_array($risultato_query))

{

 
$IdUtentePrivato=$riga["IdUtentePrivato"]; 
              
$Cognome=$riga["Cognome"]; 
             
$Nome=$riga["Nome"]; 
             
$utente=$riga["user"]; 
             
$psw=$riga["pass"]; 
              
$eMail=$riga["posta"]; 
               
$confermato=$riga["confirmed"]; 
   
// $real_price = $row["Price"];

   // $price_to_show = number_format($row["Price"],',','.','.');



    
$column_Cognome $column_Cognome.$Cognome."\n";

    
$column_Nome $column_Nome.$Nome."\n";

   
// $column_price = $column_price.$price_to_show."\n";

    //Sum all the Prices (TOTAL)

   // $total = $total+$real_price;



}

mysql_close();



//Convert the Total Price to a number with (.) for thousands, and (,) for decimals.

//$total = number_format($total,',','.','.');



//Create a new PDF file
$pdf=new FPDF();

$pdf->AddPage();

//Fields Name position

$Y_Fields_Name_position 20;

//Table position, under Fields Name

$Y_Table_Position 26;



//First create each Field Name

//Gray color filling each Field Name box

$pdf->SetFillColor(232,232,232);

//Bold Font for Field Name

$pdf->SetFont('Arial','B',12);

$pdf->SetY($Y_Fields_Name_position);

$pdf->SetX(45);

$pdf->Cell(20,6,'Nome',1,0,'L',1);

$pdf->SetX(65);

$pdf->Cell(100,6,'Nome',1,0,'L',1);

//$pdf->SetX(135);

//$pdf->Cell(30,6,'PRICE',1,0,'R',1);

$pdf->Ln();



//Now show the 3 columns

$pdf->SetFont('Arial','',12);

$pdf->SetY($Y_Table_Position);

$pdf->SetX(45);

$pdf->MultiCell(20,6,$column_Cognome,1);

$pdf->SetY($Y_Table_Position);

$pdf->SetX(65);

$pdf->MultiCell(100,6,$column_Nome,1);

//$pdf->SetY($Y_Table_Position);

//$pdf->SetX(135);

//$pdf->MultiCell(30,6,$columna_price,1,'R');

//$pdf->SetX(135);

//$pdf->MultiCell(30,6,'$ '.$total,1,'R');



//Create lines (boxes) for each ROW (Product)

//If you don't use the following code, you don't create the lines separating each row

$i 0;

$pdf->SetY($Y_Table_Position);

while (
$i $number_of_products)

{

    
$pdf->SetX(45);

    
$pdf->MultiCell(120,6,'',1);



    
$i $i +1;

}
ob_end_clean ();
$pdf->Output();