Here is the full query to the MySQL database:

$photoquery = "SELECT * 
                                FROM photos
                                INNER JOIN songs ON songs.songid = photos.song
                                INNER JOIN productions ON productions.prodid = 
photos.production
                                WHERE photoid = $var";
$photoresult = mysql_query($photoquery) or die(mysql_error());
$photorows = mysql_num_rows($photoresult);

while ($photo = mysql_fetch_array($photoresult))
{
print '<table width="64" border="0" cellspacing="0" cellpadding="5">
                        <tr>
                                <td>';
                                
                                print '<img 
src="../../gallery/'.$photo["production"].'/'.$photo
["file"].'" border="0">';

print                   '</td>
                        </tr>
                        <tr>
                                <td>'.$photo["caption"];

if(!empty($photo["thanks"]))
{
print ' <i>(Thank you to '.$photo["thanks"].' for this image)</i>';
}

print '                 </td>
                        </tr>
                </table>';
}


I've got a thumbnails page that people choose which photos they want to see 
full views of. 
The photos are categorized by song and also categorized by production. Only the 
photos 
from a certain production show up on a thumbnail page. So, on the thumbnail 
page, the 
thumbnails from the chosen production show up categorized by song. Each photo 
has a 
sort number to keep them in a specific order.

I want users to have the option of viewing thumbnails individually, or cycling 
through 
them on the full photo page that each thumbnail is linked to. This would mean 
starting at 
the photo that they click on a thumbnail, taking them to the full photo page, 
and links on 
the full photo page allowing them to move to the next photo in the sequence (if 
they come 
into the sequence at a photo whose sort number is 5, they should be able to 
move forward 
to 6 and backward to 4 without going back to the thumbnail page).

So, the next/previous links need to stay within the confines of the specific 
production and 
specific song that they are designated as.

Sorry I was unclear...again.

Reply via email to