If you are looking for a simple script to navigate next / previous image without refreshing page, this example will do exactly that using jQuery Ajax and PHP.
Following SQL code creates a table named “pictures” with 3 columns (id, PictureTitle, PictureName) and inserts pictures data into the table.
A picture will be loaded primarily, and then user can navigate to next / previous images without refreshing the page. File completely relies on ”getpicture.php”.
File gets image id from index.php, and gets image information from database, creates next/previous button returns image data back to index.php. Replace xxxxx with your MySQL username, password and database name.