Hi guys,
I wanted to create a function that prints out gallery thumbnails on a page. I've
been trying to code this part, but I'm having no luck with this:
/// Begin Code
$picsTotal = 24; // Just used a fixed number for this, but it can be any value
$rowTotal = ceil ($picsTotal / 4);
for ($rowIncrement = 0; $rowIncrement < $rowTotal; $rowIncrement++)
{
for ($colIncrement = 0; $colIncrement < 4; $colIncrement++)
{
print ("<TR>\n");
for ($picsIncrement = 0; $picsIncrement < 4; $picsIncrement++)
{
$imageFull = mysql_result($galleryAlbumQuery,$picsIncrement,"image_full");
$imageThumb = mysql_result($galleryAlbumQuery,$picsIncrement,"image_thumb");
$imageCaption = mysql_result($galleryAlbumQuery,$picsIncrement,"image_caption");
print ("<TD align=\"center\"><DIV class=\"thumbnail\">Thumbnail Here</DIV></TD>\n");
}
print ("</TR>\n");
}
}
/// End of code
it just keeps printing the first four images, and doesn't display the next batch. When this is solved, I plan to turn this into a function so that I can display the thumbnails in as many rows as I want. Any suggestions?
Many thanks in advance. 🙂