Re: next row in database

From: Stijn Verholen (stijn_at_skynet.be)
Date: 02/07/05


Date: Mon, 07 Feb 2005 19:17:27 +0100

liquidice wrote:
> I want to extract the next record from the database and display the picture
> in a 'next' link on a php page. It's sort of a slideshow gallery which
> dislpays the next image when the user clicks upon that next link
>
> "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
> news:9a6f01llchvndmpvlr47tvutag16ngjghs@4ax.com...
>
>>I noticed that Message-ID:
>><42078821$0$16583$cc9e4d1f@news-text.dial.pipex.com> from liquidice
>>contained the following:
>>
>>
>>>But I cant seem to make the next button determine and pull out the next
>>>set
>>>of records in the database and it's starting to get really irritating!
>>
>>If it's MySql it's dead easy. Just use LIMIT
>>
>>--
>>Geoff Berrow (put thecat out to email)
>>It's only Usenet, no one dies.
>>My opinions, not the committee's, mine.
>>Simple RFDs http://www.ckdog.co.uk/rfdmaker/
>
>
>

http://dev.mysql.com/doc/mysql/en/select.html

SELECT * FROM `PicTable` WHERE pictype = '2' ORDER BY id ASC LIMIT 0, 1

To get the next result, query the db again with the exact same
statement, but increment the offset (the '0' in my example would become
'1').

HTH

Stijn


Loading