ok so I have this code...
<center>
<table width="0" border="0" cellspacing="0" cellpadding="2">
<?PHP
$connect = mysql_connect (localhost, name, pass);
$db = mysql_select_db("extravag_foreverdown", $connect);
$sql1 = mysql_query("SELECT * FROM es_photocats where (`id` = $photocatid)");
$photocatinfo = mysql_fetch_array($sql1);
$pcount = $photocatinfo["pcount"];
$pcountbyfive = $pcount / 5;
for ($n = 1; $n <= $pcountbyfive; $n++) {
$sql2 = mysql_query("SELECT * FROM es_photos where (`cat` = $photocatid) ORDER BY `id` LIMIT 0,5");
print "<tr>";
while ($data = mysql_fetch_array($sql2)) {
extract($data);
print "<td>";
print "$testing";
?>
<a href="photos.php?photocatid=<? print "$cat" ?>&photoid=<? print "$id" ?>"><img src="photos/<? print "$cat" ?>/<? print "$id" ?>.gif" border="0" alt="$name" /></a>
<?
print "</td>";
}
print "</tr>";
}
?>
</table>
</center>
you can see the results of this at :
http://www.foreverdown.com/photos.php?photocatid=1
It works great for printing one row of 5 images twice. I need a way of telling my script to start 5 entries later in the database each time it goes through the for statement. So in the $sql2 statement, I would replace 0 with a variable that moves up 5 each time through the for statement so it gets the next 5 rows in the database until it runs out of entries. I hope that makes sense. Anyway, I need a way to increment the starting point on my limit for the mySQL statement each time it goes through the for statement. If you know another way of doing this, please let me know. thanks!