<table border="0" align="center" cellspacing="1" cellpadding="0">
<tr><th>Pictures</th></tr>
<tr valign='top'><td><a href="album.php?username=giuseppe&idfoto=2&index=1 ">
[img]foto/1187367421151.38.218.185_s.jpg[/img]</a></td>
<tr valign='top'><td><a href="album.php?username=giuseppe&idfoto=4&index=2 ">
[img]foto/1187371271151.38.218.185_s.jpg[/img]</a></td>
<tr valign='top'><td><a href="album.php?username=giuseppe&idfoto=5&index=3 ">
[img]foto/1187371436151.38.218.185_s.jpg[/img]</a></td>
<tr valign='top'><td><a href="album.php?username=giuseppe&idfoto=7&index=4 ">
[img]foto/1187373090151.38.218.185_s.jpg[/img]</a></td>
</table>
<p align="center"> New search</p>

Come vedi alla fine di ogni foto mi mette un </td>

per ora ho risolto così:

Codice PHP:
$count 0;
    echo 
"<tr valign='top'>";
    while (
$picture mysql_fetch_array($pictures)) {
          
          
$id $picture['id'];
          
$index++;
          
$filename htmlspecialchars($picture['filename']);
          
$extension htmlspecialchars($picture['extension']);
          
$description htmlspecialchars($picture['description']);
          
$miniatura 'foto/'.$filename.'_s'.$extension;
          echo 
"<td>";
              print 
'<a href="album.php?username='.$username.'&idfoto='.$id.'&index='.$index.' ">
                      [img]'
.$miniatura.'[/img]
                  </a>'
;
          echo 
"</td>";
          
          if(
$count==6) {    //a capo ogni 6 foto        
            
echo "</tr>";
            echo 
"<tr valign='top'>";
            
$count 0;

        }else{
            
$count $count+1;

        }
//else
        
      
}//while 
P.S. Se volessi inviare i parametri del link via POST invece che con il metodo GET, come dovrei fare?