Here is the snippet of code I'm using. Basically when someone is viewing a page and they click to see the images associated with that page, I only want 5 rows containing 3 thumbnails per row to show at a time. Then a Next and/or Previous link will be displayed to view the rest, etc...
Right now, I still get all of the thumbs to show up, not the limited number I want. What am I doing wrong with my code here?
//create table
echo "<table width = \"100%\" border = 0>";
// Make each row contain 3 or more images
$i=0;
foreach ($images_array as $row)
{
{
if (!($i % 3))
{
echo"<tr>";
}
$i++;
}
echo "<TD>";
$url = "show_images.php?imageid=".($row["imageid"]);
$title = "<IMG SRC=\"images/".$row[img_thumb]."\" ALT=\"Click for larger image\" WIDTH=160 HEIGHT=120 BORDER=1>";
do_html_url($url, $title);
echo"</TD>";
}
echo "</tr>";
// Check for Next and Previous Links
echo "<TR><TD COLSPAN=3>";
if(!isset($start)) $start=0;
$query="SELECT * FROM rpg_images WHERE imageid='$imageid' LIMIT ".$start.",15";
$result=mysql_query($query);
$query="SELECT count(*) as count FROM rpg_images";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$numrows=$row['count'];
if($start > 0)
echo"<a class=\"link\" href=\"".$PHP_SELF."?start=".($start - 15)."\">Previous</a><BR>\n";
if($numrows > ($start + 15))
echo"<a class=\"link\" href=\"".$PHP_SELF."?start=".($start + 15)."\">Next</a><BR>\n";
echo "</TD></TR>";
echo"</table>";
}
😕 Thanks for any help I can get, sux being a newbie 🙁