[BNM] Moving to next record in MySQL

Stuart Dunkeld stuartd at gmail.com
Thu May 1 10:36:53 BST 2008


Something like SELECT TOP 1 ID FROM TABLE WHERE ID < 1325 ORDER BY ID DESC

Stuart

On Thu, May 1, 2008 at 10:27 AM, delarge <delargerock at gmail.com> wrote:
> Hi hey yo
>
>  I wondered if there is a way to do this in MySQL...
>  Say I pick the latest id like SELECT * etc. LIMIT 1
>
>  and that has an id of 1325 for example...
>  so we have a url like:
>  site.com/?id=1325
>
>  now on the next page I want to select the next record down, regardless of
>  its id - so it might be 1287, not neccessarily 1325 -1...
>
>  I know you can do an offset kind of thing like this:
>  ORDER BY id DESC LIMIT 5, 1
>
>  But I don't think that would help...
>  Am I making sense?  Can anyone help?
>
>  --
>  Paul Burgess
>
>  iampaulburgess.co.uk
>  delarge.co.uk
>  urbandirty.com
>  --
>
>  BNM Subscribe/Unsubscribe:
>  http://www.brightonnewmedia.org/options/bnmlist
>
>  Archive Search - http://icanhaz.com/bnmarchive
>
>  BNM powered by Wessex Networks:
>  http://www.wessexnetworks.com
>


More information about the BNMlist mailing list. Powered by Wessex Networks