|
|
 |
Re: FN-FORUM: Choosing the next record in MySQL DB
date posted 14th May 2008 12:31
On Wednesday 14 May 2008 14:57:51 Dai Williams wrote:
> Page.php?id=3D8&next=3D1 (nextlink)
> Page.php?id=3D8&prev=3D1 (previous link)
>
> Then the page checks for next and prev params and query does e.g.
> "....where id < $id limit 1" rather than usual "........where id =3D $id"=
=2E=20
> This saves on db access and has the (probably very marginal in most cases)
> extra benefit that if the next and previous change before the link is
> clicked it is handled dynamically (e.g. if next record is deleted between
> page loads it doesn't cause a "not found").
Except if you are at the beginning or end of the list, you do.
=46rom a usability point of view there should only be a "next item" link
if there's a next item to go to.
|
 |
|