[thelist] artificial sort order in db generated online form

Canfield, Joel JCanfield at PacAdvantage.org
Thu Jul 21 17:31:15 CDT 2005

We have a form available on our intranet and external site which they've
decided will be generated from a database; field name, validation info,
display text, categories, etc.

The categories, and items within each, are sorted in a manner which
makes sense to our business but requires a 'sort field'

Anyone have experience with a smart way to do this which allows for
growth? As new categories are added, we have to tuck a new value into
the sort field. The guy who built and populated the db put the initial
values in, and then just numbered them sequentially. So, when I tuck in
a new category or item, I have to renumber everything after it.

My thought was to do the sort numbers in 100s; f'rinstance, with 9
categories they'd be 100, 200, 300, . . . 800, 900 and I could add in
750, then 725, 730, 710, and never have to renumber (we do eventually
remove old items, but that's with an 'enable/disable' bit field.)

We'll never have more than a dozen categories, nor more than two dozen
items in any category.

Does this make sense, or is there a better way?



More information about the thelist mailing list