MySQL Forums
Forum List  »  PHP

Select the next row?
Posted by: Liam
Date: April 27, 2006 03:41AM

Ok, so here's my problem. I currently have a gallery (PHP), which pulls data from a table. However, at the moment I simple am doing id+/-1, which is fine as I am ordering the id's as 1,2,3...etc.

However, if for example id number 8 gets deleted, page 7 would still skip to page 8 (And the same for page 9 in reverse) which would return nothing. Rather than using the id I would like to be able to skip to the actual next row in the table, which means all id's could be random.

While on the subject I'm also interested in how I would go about knowing if it was the first/last row in a table, so I could skip straight back to the beginning/end.

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
Select the next row?
April 27, 2006 03:41AM
April 27, 2006 05:30AM
April 27, 2006 06:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.