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

  • SEARCH
  • Home
  • 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 9270999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:30:32+00:00 2026-06-18T15:30:32+00:00

I made a very simple image gallery, with a Next and Preview button. My

  • 0

I made a very simple image gallery, with a Next and Preview button. My content is generated dynamicly so i have dynamic URLS

<a href="content.php?id=<?php echo $row['id'] -1; ?>" ><div id="next">Next </div></a>
<a href="content.php?id=<?php echo $row['id'] +1; ?>" ><div id="prev">Prev </div></a>

Everything is work fine, but when I hit the “Next” button on my last image or the preview button on my first image, I got a blank page, beacause there are no more records in the database. So i need an IF statement.

Example: If (no more records) echo ‘error’ else echo ‘some message’

Thank you

  • 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-06-18T15:30:34+00:00Added an answer on June 18, 2026 at 3:30 pm
    <a href="content.php?id=<?php
     $maxValue =6; //Enter Limit here
     If (($row['id'] - 1) < maxValue){
     echo $row['id'] - 1;}
    ?>" ><div id="next">Next </div></a>
    

    I do not know if this makes sense to you. I hope I understood your question. I did not see another answer. If its not let me know and I will delete my response by adding a note to your question.

    Also as:

    <a href="content.php?id=<?php $maxValue =6; If (($row['id'] - 1) < maxValue){ echo $row['id'] - 1;} ?>" ><div id="next">Next </div></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a very simple AppleScript to close tabs in Safari. The problem
in my application I made a very simple binding. I have a NSMutableArray bound
I have a custom listview and made overlapping very simple: in onDraw method, I
I have made a very simple custom object pictureData . Here is the .h
I have small problem. I have made very simple bootloader. After it's creation I
I have made a very simple game in titanium mobile. I only use 90k
I need a very simple(*) image editor made in Flash so the users of
I have made a very simple 2D Java game class made up of the
I am a rather new C++ programmer. I have made a very simple game
I made a very simple application to store variables that can be edited onto

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.