in reply to Re: next prev record mysql table
in thread next prev record mysql table

I really don't like this idea for one reason. Your data is going to move and shift, so your pages change and shift.

It's probablybest that you keep track of the last element retrieved. For the first page:

select * from table order by something limit 10

and for next pages, do

select * from table  where value > lastValueFromPriorQuery order by something limit 10

It's a pain in the ass when people add data or delete it and your pages go a little nutty. Your idea is great if your data doesn't change.

Replies are listed 'Best First'.
Re: Re: Re: next prev record mysql table
by bradcathey (Prior) on Dec 07, 2003 at 03:00 UTC
    I see your point, however I seems that because I am only grabbing and displaying one record at a time, and keeping track of it, I shouldn't have any problems other than an unexpected record displaying when cycling back through previous records. But I'm open to refinement if any one has a safer/cleaner way of doing this.

    —Brad
    "A little yeast leavens the whole dough."