RE: FN-FORUM: Choosing the next record in MySQL DB
date posted 14th May 2008 13:57
Dom Latter wrote:
> On Wednesday 14 May 2008 14:57:51 Dai Williams wrote:
>
>> Page.php?id=8&next=1 (nextlink)
>> Page.php?id=8&prev=1 (previous link)
> Except if you are at the beginning or end of the list, you do.
>
> From a usability point of view there should only be a "next item"
> link if there's a next item to go to.
Good point, could be got around by selecting id,max(id),min(id) and checking
if you are at either end, that way it is still one query. Removes the
"cleverness" of previous post in that a subsequent delete or insert would
not be picked up, but solves the original problem with one query, which
while it is certainly not the definite objective seems more elegant?
Regards,
Dai