Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3692326
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:14:58+00:00 2026-05-19T04:14:58+00:00

I am working on making a album-viewer like facebook. I have made the setup,

  • 0

I am working on making a album-viewer like facebook.

I have made the “setup”, you can see the photo, what album its in and so, now I would like to make the “next” “previous” buttons work.

I have seen them using preloading while viewing a current, and i wish to accomplish something like that.

But first of all, how can I make the “next”? What are the procedure to make the “next” work.

With this I mean how should I code it, so it knows which picture is next? I would like to sort it from the date(order by date), so the next should be newer than the current date, and previous older than the current date.

My database looks like this:

album
id uID title

album_photos
id aID uID photo date

aID holds the id of the album(album ID), uID holds the id of the user(userID).

I also want to make use of javascript too. Make an ajax request, instead of refreshing whole page.

So my question is:

What is the procedure of making next/prev button, if I would like to make it work after date DESC, how does the javascript look like? An ajax request to file.php, that are grabbing the latest image from the database and then on success it replace the current photo and show it? What about the adressbar, in facebook the adressbar changes align with loading new photo.

Any well explained answer for procedure of making this, will accept the answer

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:14:58+00:00Added an answer on May 19, 2026 at 4:14 am

    If you are sorting your photos by date DESC and you got the current photos date do the following:

    • To find the next photo: Order your photos by date DESC and select the first photo whos date is smaller than the date of the current photo. Fetch only the first one.
    • To find the prev photo: Order your photos by date ASC and select the first photo whos date is greater than the date of the current photo. Fetch only the first one.

    Construct the SQL-Statements for this by yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on making a book catalog searchable using Solr. I have written
I have been working on making a form that uploads an image through ajax
I have been working on making my website mobile compatible. Whilst I have successfully
I am working on making a widget like this one here: http://www.comehike.com/outdoors/widget.php?hike_id=176&height=400&width=700 And for
Working on making an inventory page for work. I have written a page that
I am working on making a search bar above the UITableView, like in the
I am working on making a loupe tool using C#. Much like this one:
I am working on making my first Hubot script which would add a quick
I am working on a project and I would like to send an entity
I have been working on making an application for editing game plugins for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.