Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

October 5, 2010


Find Next and previous mysql records relative to current page

I have photo details page and i need to put next photo and previous photo link. To achieve this, i need to get previous record and next records relative to index or current photo record from mysql photo table. Generally we assume that it can be achieve by add one in current record’s auto increment id and minus one in current record’s auto increment id. But this is not the correct way to get next and previous record..