Good day,

I've been trying to figure out a way to get the next record by order.

Say I have 10 records and an 'order' column/field in the table being 1, 2, 3, 4.....9, 10.
So I start at record with 'order' 1 and I need to select the next, it will be 2, etc.

Here is my code: http://pastebin.com/eJszP9v3

What happens when I get to 10? How can I automatically loop and get to 1 again?
It has to be dynamic. Is there some WHERE clause I can put in the query to look for > 10 else == 1?

Thank you for your input!