Re: Sorting
- From: Lasse Vågsæther Karlsen <lasse@xxxxxxxxxxx>
- Date: Mon, 04 Feb 2008 22:11:13 +0100
Jeff Johnson wrote:
Hi,
I'm building the backend of a site for a client and one of the requirements is to add data to populate dropdowns which is straight forward, but they also want to control the order they appear in the dropdowns. I've created a field called 'Sort' using an INT for the datatype. I want to determine the how to swap the 'Sort' field values when the user chooses to to update the order. Can someone please recommend the best way to allow a user to update the sort field?
Name Value Sort
abc ABC 10 (change to 30)
def DEF 20
ghi GHI 30 (change to 10)
Thanks,
Jeff
Of course, you could just execute some SQL.
UPDATE yourtable SET Sort = 10 WHERE Name = 'abc'
UPDATE yourtable SET Sort = 30 WHERE Name = 'ghi'
--
Lasse Vågsæther Karlsen
mailto:lasse@xxxxxxxxxxx
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
.
- References:
- Sorting
- From: Jeff Johnson
- Sorting
- Prev by Date: Re: This program is not thread safe and cause run time error in debug mode
- Next by Date: Re: Sorting
- Previous by thread: Re: Sorting
- Next by thread: Re: Sorting
- Index(es):
Relevant Pages
|