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.

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

Printing a webpage
I use this to print the webpage: o

Newb advice
Hi all,

I'm a flash front end designer and I've taken on a project that needs some back end p

login page does not execute a else statement
I've created a login page using sessions.
When an incorrect user name or password is entered then

Unidentified index error in a simple form
I have been trying to make an HTML form that is handled by a PHP script. So far my attempts to get i

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

Simultaneous select/update/insert
Hi

How would I need to go about when 2 users update a single row simultaneous? And how would

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

PHP XML extraction text
I would like to extract an xml text and have that text directly echo(print) out on my web page. Her

Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..

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