"Jacob Atzen" <jacob@aub.dk> a écrit dans le message de news:
slrncusnva.9mt.jacob@morpheus.aub.dk...[color=blue]
> On 2005-01-19, Bob Bedford <bedford1@YouKnowWhatToDoHerehotmail.com>
> wrote:[color=green]
>> I've a page where I get the result of a query. Each result points to a
>> page where there is the detail of the record. I'd like to add
>> "previous" and "next"buttons. The only way I've found is to put the
>> results in an array, then on any page, the array will tell me the next
>> and previous record. It's there a better way using mysql ?[/color]
>
> Offsets:
>
> SELECT [...] FROM [table] LIMIT 20, 1;
>
> <http://dev.mysql.com/doc/mysql/en/SELECT.html>
>[/color]
List.php (with limit 20):
<a href="detail.php?article=2>detail 2</a>
<a href="detail.php?article=3>detail 3</a>
<a href="detail.php?article=4>detail 4</a>
.....
Ok, once I click on article detail 3, how to make previous or next from
there since I'm on an other page and I don't run the query every time ? From
detail.php, it wouldn't be possible to go to 2 or 4 without coming back to
list.php.
Bob