how can i make next page and prev page in my gallery script ..
when
mid = id of images
path = link of images
i need 2 button next to get next image and prev to get last image ?? how can i do it ?

$mid=$_GET['mid'];
$qur="select * from images where mid='$mid'";
$res=mysql_query($qur,$conn);
?>
<?php while($row=mysql_fetch_array($res)){ ?>

<div class="gallery-img">
<a href="admin/<?php echo $row['path'] ?>" rel="prettyPhoto" class="portfolio-img" title="<?php echo $row['image_title'] ?>">
<img src="admin/<?php echo $row['path'] ?>" alt="<?php echo $row['image_title'] ?>" width="100%" height="100%" />
</a>
</div>  

<?php } ?>
Member Avatar for diafol
  1. get the total number of pics from the db/search. I assume mid related to member_id as opposed to individual photo_id.
  2. Assuming that you're displaying one image at a time, you can use an 'almost pure' js, an ajax or a pure php solution.

The js version will load all image urls into an array, so that button movement will just change the url of the image src attribute. No page refresh required.
The php version will load the image based on the button (form) submission. Page refresh will happen.
The ajax version can be simple or complicated, but will be similar to the php version, you just hijack the button click to prevent form submission. This has the 'dubious' advantage over the js-only version of being up-to-date-ish. That is if it checks the server for the new image, it can also get the latest number of images, so if an user adds a photo while you're perusing, it should be updated. No page refresh. The downside is that you once again involve the server.

So, what sort of solution are you looking for?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.