Best way to check for end of a record and send it back to the first record


Posted on 16th Feb 2014 07:03 pm by admin

I'm hoping someone can help me out and explain the best way to accomplish this.

What I'm doing I'm pulling data from a data base. I display the information 1 item at a time then have a next and previous link to navigate forward or backward through the records.

Did you know?Explore Trending and Topic pages for more stories like this.
The issue is when it gets to the last record and I press the next link i get errors cause their is no more records. so what I'm wondering what a good way to send it back to the first record? would it make sense to store the total number of records in a variable and then load the load the id's pulled from the database into an array and check against the end of the array for the end of the records and send it back to the first element of the array?

Any explanations are examples would be helpful even a link to somewhere showing this would be good. I haven't found one yet.
No comments posted yet

Your Answer:

Login to answer
290 Like 13 Dislike
Previous forums Next forums
Other forums

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

Get value from Select menu
Hi!

Have tried to find the solution on the web. Don't know if there is an easy one. A descrip

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

How to write on database when a link is clicked?
Hi, I have a list of products in a gridview. When the link is clicked currently it takes to an ext

Must-Know Topics of PHP
Can you guys list the must-know topics of PHP. I am still a learner and I am trying to cover most of

User registration and login
I don't know whether this is the correct forum, if not i apologise but am pretty desperate at the mo

Help to integrate whois Domain Details to website
Hi,

can i know is their any php script r methods to add domain details to my website.

Strip Slashes Help
I've got a script that i've downloaded of the net to edit multiple fields from my sql database, and

user validation always displaying invalid ? please help
Hello,

I have 2 accounts and there is a field in mysql called validated it can be either &quo

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash