I have here code that displays thumbnails from mysql and puts them into a table.
it works fine.
$sql = "select * from images";
$result = mysql_query($sql);
$num_results = mysql_num_rows($result);
echo "<images>\n";
echo "<table border='1' cellpadding='0' cellspacing='6' bordercolor='#000000'>";
for($i=0;$i<$num_results;$i++)
{
$row = mysql_fetch_array($result);
if(($i%6)==0)
{
echo "<tr>\n";
}
echo "<td>";
echo "<a href=\"display.php?file=".$row['pic_path']."&pic_descrip=". $row['pic_descrip']."&pic_area=" . $row['pic_area']."\"><img src=\"".$row['thum_path']."\" border='0'></a>";
echo "</td>\n";
if (($i%6)==5)
{
echo "</tr>\n";
}
}
echo "</table>\n";
I was just thinking though, i only want a max of 30 images on one page (per table). anything over that, i would like displayed on another page.
I presume i need some sort of counter on thum_path untill it reaches 30. but i dont know what to do after that to make them apper on another page??
Any help and ideas would be greatly apreciated.
Thanks.