Hi i'm just looking for a little help with this one.....
i have a thumbnail index which displays all the images as links which you can click on and look at a larger sized version of each image, below the large image is a "<< prevoius","back to thumbs" and a "next >>" link the "<<previous" is easy to stop from displaying when there are no images less than 1, but i'm struggling stopping the "next >>" link showing when there are no more images to that particular thumbnail group the code is here:
<?php
$previous=$picture_id-1;
$next=$picture_id+1;
if($previous<1)
{
echo("..........");
}
else
{
echo("<a href=\"projectfullsize.php?id=$previous&prjct=$project_id\"><< previous</a>");
}
echo(" ");
echo("<a href=\"projectthumbs.php?id=$project_id&prjct=$project_id\">back to thumbnails</a>");
echo(" ");
if(!mysql_query("SELECT * FROM projects WHERE project_number = '$project_id' AND picture_number = '$next'"))
{
echo("..........");
}
else
{
echo("<a href=\"projectfullsize.php?id=$next&prjct=$project_id\">next >></a>");
}
?>
the problem is with the condition:
if(!mysql_query("SELECT * FROM projects WHERE project_number = '$project_id' AND picture_number = '$next'"))
the database feilds have a group id and a picture id so group 1
will have images 1 to 9, and group 2 will have images 1 to 12, so i guess im looking for the correct test condition to check that if image 13 doesnt exist in group 2 that when displaying image 12 instead of the "next >>" link displaying it echos the "........." instead,
thanks in advance to anybody helping
regards
sean