ho risolto cosi:

Codice PHP:
    
                        
echo "<h3>Statistiche dell'anno $year</h3>
"
;
                        
$tab="";
                        
$tab.="<table>
                            <thead>
                            <tr>
                            <th>Biblio richiedente</th>
                            <th>Numero richieste borrowing</th>
                            <th>Numero articoli ricevuti</th>
                            <th>Numero richieste lending</th>
                            <th>Numero articoli forniti</th>
                            <th>Differenza tra ricevuti e forniti</th>
                            </tr>
                            </thead>"
;
                                while (
$row=$_SESSION['db']->fetch($result))
                                    {
                                        
$richiedente$row["bi_idrichie"];
                                        
$rich_bw$row["re_richieste_bw"];
                                        
$num_ricev$row["re_articoli_ricev"];
                                        
$rich_ln$row["re_richieste_ln"];
                                        
$num_forni$row["re_articoli_forni"];
                                        
$diff_ricev_forni$row["diff_ricev_forni"];

                                        
$tab.="
                                              <tbody align="
."center".">
                                              <tr>
                                                    <td>"
.$richiedente."</td>
                                                    <td>"
.$rich_bw."</td>
                                                    <td>"
.$num_ricev."</td>
                                                    <td>"
.$rich_ln."</td>
                                                    <td>"
.$num_forni."</td>
                                                    <td>"
.$diff_ricev_forni."</td>

                                              </tr>
                                            </tbody>"
;
                                    }
                                    
                            
$tab.="</table>"
                            echo 
$tab