Hello,
(This question is a little long in hopes of making it clear what I'm trying to achive... please still read it!! 😉 )
I need to be able to manually change the order in which database records are displayed. Unfortunately I'm not talking about simply ordering them by column type.
Let's say I have a client database with 2 columns:
client_id - integer (auto_increment)
client_name - varchar
With this table I could sort the records by the client_id or by the client_name... BUT I would like to be able to manually change the order. To do this I would like to add another column such as:
client_sortorder - integer
This column's purpose would be to hold a sequential number which would be the order I want the records displayed on a web page.
Without the client_sortorder column the records would be displayed something like:
client_id client_name
1 Amy
2 Bob
3 Chris
Let's say I would like "Chris" displayed before "Bob"... there no simple way to do this. So I would like to use the client_sortorder column to control the order the records will be displayed:
client_id client_name client_sortorder
1 Amy 1
2 Bob 3
3 Chris 2
Now I can control it so "Chris" will display before "Bob".
The PROBLEM... I don't know how to edit client_sortorder column so that I can get it filled with sequential numbers.. and to change each of these sequential numbers the next time I want a record displayed in a different position.
I'd like to have all the records displayed in a list, and beside each record to have an UP/DOWN arrow which would move the record above or below the records over and under it and then update the client_sortorder column so they will continue to be displayed in that order.
Any ideas on how to edit each of the record's sequential numbers in the client_sortorder column to achieve this????
THANK YOU!
Peter