Hey folks, a bit of a problem.
Whilst grabbing the recordset from my database, I wanted to use that to format a nice and pretty thumbnails table for some images - my plan was to have the table 3 columns wide, and however many rows down.
Here's the problem - each row from the recordset corresponds to one row in the outputted table - meaning 3 of the same image per row, rather than 3 different images per row.
head to http://www.darwenstheory.net/main.php?s=showgig&gig=Paladinos you can see what's happening.
Here's the code I'm using to format the recordset right now:
<?
echo $what;
$SQL="SELECT ID, image_path, thumb_path FROM Images WHERE gig='". $what ."' ORDER BY ID";
$SQL_Result=mysql_db_query($DB,$SQL,$sql_conn);
$SQL_Rows=mysql_num_rows($SQL_Result);
while($row = mysql_fetch_assoc($SQL_Result)) {
echo "
<tr>
<td><div align=\"center\"><a href=\"main.php?s=showpic&iid=".$row['ID']."\"><img src=\"".$row['thumb_path']."\" style=\"border-style: solid; border-color: black; border-width: 1px;\"></a><br><br><a href=\"main.php?s=showpic&iid=".$row['ID']."\"><img src=\"http://www.darwenstheory.net/images/eye.gif\" border=0></a> <a href=\"".$row['image_path']."\" target=\"_blank\"><img src=\"http://www.darwenstheory.net/images/disk.gif\" border=0></a></div></td>";
echo "<td><div align=\"center\"><a href=\"main.php?s=showpic&iid=".$row['ID']."\"><img src=\"".$row['thumb_path']."\" style=\"border-style: solid; border-color: black; border-width: 1px;\"></a><br><br><a href=\"main.php?s=showpic&iid=".$row['ID']."\"><img src=\"http://www.darwenstheory.net/images/eye.gif\" border=0></a> <a href=\"".$row['image_path']."\" target=\"_blank\"><img src=\"http://www.darwenstheory.net/images/disk.gif\" border=0></a></div></td>";
echo "<td><div align=\"center\"><a href=\"main.php?s=showpic&iid=".$row['ID']."\"><img src=\"".$row['thumb_path']."\" style=\"border-style: solid; border-color: black; border-width: 1px;\"></a><br><br><a href=\"main.php?s=showpic&iid=".$row['ID']."\"><img src=\"http://www.darwenstheory.net/images/eye.gif\" border=0></a> <a href=\"".$row['image_path']."\" target=\"_blank\"><img src=\"http://www.darwenstheory.net/images/disk.gif\" border=0></a></div></td>
</tr>";
}
?>
I have also tried using a for { } loop to format the recordset as well, but that performed the same as the while loop - 3 of the same image per row. Any ideas?
Thanks,
Kinsbane