Jump to content

Help with "previous" and "next" links


veroaero

Recommended Posts

Hello,

 

I am trying to figure out how to add "next" and "previous" links to a full view page in a photo album I am doing. I can't figure out how to do it in this case though and I would appreciate some hints/advice on how to do it.

 

Here is the php code where I am trying to add the links:

 

// Full Size View of Photo
else if( $pid )
{	
	$result = mysql_query( "SELECT photo_caption,photo_filename,photo_id FROM gallery_photos WHERE photo_id='".addslashes($pid)."'" );
	$row = mysql_fetch_array($result) or die(mysql_error());
	$photo_caption = $row['photo_caption'];
	$photo_filename = $row['photo_filename'];
	$photo_id = $row['photo_id'];
	$nr = mysql_num_rows( $result );

	if( empty( $nr ) )
	{
		echo"\t There are no photos in this category! \n";
	}
	else
	{	

		$result2 = mysql_query( "SELECT category_name FROM gallery_category WHERE category_id='".addslashes($cid)."'" );
		$row2 = mysql_fetch_array($result2) or die(mysql_error());
		$category_name = $row2['category_name'];

		$result3 = mysql_query( "SELECT photo_id FROM gallery_photos WHERE photo_category='".addslashes($cid)."'" );
		$row3 = mysql_fetch_array($result3);

		echo"<br><a class='pinkLink' href='daif_vimmel.php?cid=$cid'>&raquo ".$category_name."</a><br>\n";
		echo"<div class='fullviewbox'> \n <img class='fullview' src='".$images_dir."/".$photo_filename."' alt='".$photo_caption."' >\n
		<br>\n
		$photo_caption \n
		</div>";

	}
}

 

Thanks in advance,

Vero

Link to comment
Share on other sites

Yes, I want to paginate my results. I know how to do that when I loop through my results, but here I have already decided which photo to show on the previous page, and I don't loop through the full view photos. I was just hoping for some simple hints how to get pagination in this case because I can't figure out how to do it.  ???

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.