I've got a page where I am producing a set of ten photos of members from my site. I want to dispaly these ten photos in a table where there are two rows with five columns for a total of ten photos. Here is how I am using echo to display the ten photos with their appropriate name and a hyperlink for each one. I know I have to use <tr></tr> tags for the beginning and end of each row, but how would I put this into my results? The problem being that my results are part of a loop. This is what I have.
$result = mysql_query("select membername from whatever limit 0,10") ;
while ($row = mysql_fetch_array($result)){
$membername= $row["membername"];
$sql =mysql_query("SELECT * FROM images WHERE membername = '$membername' ");
$img_info = mysql_fetch_array($sql);
echo "<td>";
echo "<a href=photopage.php?profile=$membername>";
echo img_tag($img_info["img_file"], array("x"=>"100", "y"=>"100"));
echo "<br>";
echo "$memberrname";
echo "</a>";
echo "<td>";
}