Salve a tutti ragazzi,
come al solito chiedo aiuto a voi
devo creare una tabella dinamica nella quale inserire i record che estraggo dal database secondo un determinato criterio di ricerca.

Questo è il codice PHP che ho creato:

Codice PHP:
if (isset($_POST['send'])) {
            
$funz trim(stripslashes($_POST['funz']));
            
            if (
$funz == "") {
                echo 
"<script type=\"text/javascript\">alert(\"Non hai selezionato alcun campo per la ricerca!\\nVerifica e riprova!!\"); history.go(-1)</script>";
                exit;
            }
            
            
$check2 mysql_query("SELECT * FROM $tbl_name WHERE funzione = '$funz'");
            
$arr2 mysql_fetch_row($check2);
            
            
$count="1";
             
$tab=""
             
$tab.="<table width=\"983\" border=\"1\"> 
                            <thead> 
                            <tr> 
                            <td width=\"31\" align=\"center\">[b]ID[/b]</td> 
                            <th width=\"100\" align=\"center\">[b]NOME[/b]</th> 
                            <th width=\"100\" align=\"center\">[b]COGNOME[/b]</th> 
                            <th width=\"150\" align=\"center\">[b]E-MAIL[/b]</th> 
                            <th width=\"88\" align=\"center\">[b]FAX[/b]</th> 
                            <th width=\"88\" align=\"center\">[b]FUNZIONE[/b]</th> 
                            <th width=\"88\" align=\"center\">[b]ISTITUTO[/b]</th> 
                            <th width=\"90\" align=\"center\">[b]SEDE[/b]</th> 
                            </tr> 
                            </thead>"

            
            while (
$arr2[0]!="") {
                echo 
$count;
                
                
$tab.=
                       <tbody align="
."center"."> 
                       <tr> 
                       <td>"
.$count."</td> 
                       <td>"
.correzione($arr2[5])."</td> 
                       <td>"
.correzione($arr2[6])."</td> 
                       <td>"
.$arr2[7]."</td> 
                       <td>"
.$arr2[8]."</td> 
                       <td>"
.$arr2[11]."</td> 
                       <td>"
.$arr2[9]."</td> 
                       <td>"
.$arr2[10]."</td>
                       <td>"
.$arr2[18]."</td> 
                    </tr> 
                    </tbody>"

                    
                
$check2 mysql_query("SELECT * FROM $tbl_name WHERE funzione = '".$funz."'");
                
$arr2 mysql_fetch_row($check);
            
                  
$count++;
                
            }
            
$tab.="</table>";
            echo 
$tab;
    } 
il problema è che il while mi si blocca sempre subito e mi scrive un solo risultato nella tabella, senza mettere gli altri....
a cosa può essere dovuto?
grazie