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

include problem
I have my root folder as:
Code: $root = $_SERVER["SITE_HTMLROOT"]; // the server root<

imap: how to save a copy of sent emails to sent elements
Hello my friends,

I am writing an online emailing application with inbox outbox/sent elements

Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

building a function with multiple outputs
I want to build a function that has multiple outputs.

I know but am not to sure how I should

jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

How do I send data using an html link
Hi

If I have
<a href="main_file.php">

How do I send data t

Using mysql_real_escape_string for displayed content
On my website users can input data into a textarea and it will store it in the mysql database. But,

Problems with array
This code is the last lines in an upload script that uploads 4 images at the same time and writes th

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