Thanks Barney, thats *exactly* what I was looking for!

-- 
--Matt Robertson--
President, Janitor
MSB Designs, Inc.
mysecretbase.com


On Sun, 12 Dec 2004 11:12:27 -0800, Barney Boisvert <[EMAIL PROTECTED]> wrote:
> I'm not sure exactly what you're looking for, but if it's SQL, I've
> done this in the past:
> 
> SELECT *
> FROM table
> WHERE id < #currentId#
> ORDER BY id DESC
> LIMIT 1
> 
> for getting the previous item.  Just flipt the < to > and make the
> order ASC to get next record.  The LIMIT clause is MySQL's version of
> MS products' TOP clause.  If you want to "fast forward", the LIMIT
> clause also specifies an offset, so you can do LIMIT 19, 1 to pull the
> 20th item in the list.  With MS's TOP clause, you have to pull all 20,
> and then just look at the last one, I believe.
> 
> cheers,
> barneyb
> 
> On Sun, 12 Dec 2004 10:58:50 -0800, Matt Robertson
> 
> 
> <[EMAIL PROTECTED]> wrote:
> > I have an application where the user selects a record via a key
> > lookup, and then that record is displayed individually.  From there I
> > want to be able to click a '<' button to go to the previous record in
> > the sequence, or a '>' to go to the next record, and continue to
> > select records via this method as an alternative to the key lookup.
> >
> > I did this in an entirely different environment where I was able to
> > use native controls that allowed straight up SELECT NEXT and SELECT
> > PREVIOUS commands, where I was also able to throw those commands into
> > a loop for fast forward and rewind as well.  Don't expect to get that
> > in the web world, but I need the next/previous.
> >
> > I think I can come up with something, but the convolutions necessary
> > to make it work are making my head hurt.  Is there something simple
> > and obvious I have missed on this (for me) Sunday morning?.
> >
> > --
> > --Matt Robertson--
> > President, Janitor
> > MSB Designs, Inc.
> > mysecretbase.com
> >
> 
> 
> --
> Barney Boisvert
> [EMAIL PROTECTED]
> 360.319.6145
> http://www.barneyb.com/blog/
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187285
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to