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

Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but

PHP mail() returns true but doesn't work
First off I apologize if this is a newbie question, and I generally don't like asking questions that

newbie question
Hi out thereIm totaly new in this forum and to .net and vb so here is a totaly newbie question.I wan

Inserting a check in checkbox from array value
Hello all,
I have a bit of code that works for a select option box, but does not work for my chec

Sessions Value Not Saved
Hi,

Im making a login form and im using this code:
Code: if($login=="true"){

Rss feed question
Hi

My blog and my website are different. Am i able to take my rss feed
from my blog and p

Help With editting and deleting form
So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.png
This table

Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
In the html page one text box

modifying a property of an object from a different class
I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance =

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

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