RE: select next/previous *record*?

2004-12-13 Thread Dawson, Michael
Don't you need to know something else if you use Last Name as the index?
What if there are multiple John Smith's?

I haven't actually done this, but what if you pulled all records with
the last name they selected, then used array notation to pull the ID
from the record before and after the current record?

Too bad databases don't generally have a numeric, sequential record
number like ColdFusion's query object (currentRow variable). 

-Original Message-
From: Matt Robertson [mailto:[EMAIL PROTECTED] 
Sent: Sunday, December 12, 2004 1:41 PM
To: CF-Talk
Subject: Re: select next/previous *record*?

 Quick question...are ya using DreamweaverMX?

Nope.  Another complication I didn't mentuion before is the user has the
ability to select which index is current, so they might be indexing on
ID, and cycling up and down thru the numbers, or one of several other
fields, such as Last Name.  I'm working thru that now. 
Don't see how it would work in the ID-based example.

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



~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187409
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


Re: select next/previous *record*?

2004-12-13 Thread Matt Robertson
Yes, I was thinking along the same lines, but I can't think of a way
to do it that would be even remotely efficient across about 10 key
fields they want to page thru display on.   I may revisit the issue
when I have some more time but these guys have signed off on foregoing
this feature for now.

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

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187460
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=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: select next/previous *record*?

2004-12-12 Thread Jeff Small
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?.

Quick question...are ya using DreamweaverMX?


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

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187284
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


Re: select next/previous *record*?

2004-12-12 Thread Matt Robertson
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


Re: select next/previous *record*?

2004-12-12 Thread Matt Robertson
 Quick question...are ya using DreamweaverMX?

Nope.  Another complication I didn't mentuion before is the user has
the ability to select which index is current, so they might be
indexing on ID, and cycling up and down thru the numbers, or one of
several other fields, such as Last Name.  I'm working thru that now. 
Don't see how it would work in the ID-based example.

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

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

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187288
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


select next/previous *record*?

2004-12-12 Thread Matt Robertson
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

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187281
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


Re: select next/previous *record*?

2004-12-12 Thread Barney Boisvert
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:187283
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