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

php file erros / need help please
Hello

Someone decoded a zend file for me.. after uploaded it on ftp i get some errors, i trye

getting a website's source code as a variable? How?
Hey guys, is there any way for me to get the source code of a website as a variable for me to work w

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

I hav

Selecting an "empty" date formated field
How do you select an "empty" date field? I've tried the few ways I can think.
SQL> select

How to Create a Dynamic table
col1 col2 date1 date2 date3 date4..........
a b v1 v2 v3 v4

Login Script Issues
I am using a script I got from http://phpsense.com/php/php-login-script.html in order to allow peopl

textfield unchanged
hi,
i want my form to know whether its textbox is unchange or not.

if($textbox == 'unchang

DataTable Help Required
Hi all I am creating an app that utilises and MS Access back end and queries it quite a bit at vario

New Login Script
Hi all, i attempted to create a whole new login script witch isnt working for some reason i dont kno

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