Prova in questo modo dovrebbe andar bene:
Codice PHP:
while($row=mysql_fetch_array($query1))
{
$nome[]=$row['nome'];
$cognome[]=$row['cognome'];
}
$num_rows=ceil(count($nome)/3);
$table="<table width='162'border='1'>";
$a=0;
for($i=0;$i<$num_rows;$i++)
{
$table.="<tr>";
for($k=0;$k<3;$k++)
{
$a++;
$table.="<td width='33%' >
[img]scudetti/ascoli.png width=[/img]<center><font class='fontprofilo'>".$nome[$a-1]." ".$cognome[$a-1]."</center></td></font>
</td>";
}
$table.="</tr>";
}
$table.="</table>";
echo $table;