Changing the order of a top 40 list table.
Hi what I'm looking to do is to allow a user to change the order of a list of 40 items. Its going to be a sort of top 40 list.
There will only ever be 40 items in the table but the order of them will change from week to week, some may be deleted and others added in there place but there will always be 40 items.
I need them to show in a set order on the page so I was using the Id column in the table to do this ie Id 1 shows first Id 40 shows last in the list.
But how would I build the part that allows someone to change the order of this table? If this is a really easy thing then sorry for being a bit thick but its been one of those days!
Any help would be really appreciated with this. If I've not explained it very well let me know and I'll try to do it more clearly.
Thanks in advance
Can you explain, what type of sorting you need.
Is it some thing like desc or asc?
What I need to be able to do is say "red shoes" was ranked 3rd last week but is now gone up to 1st place I need to be able to change its order so that it now shows in 1st place this week and something else would then show in 3rd place. Does that make sense?
Create a table called
rankings which holds an item ID, a date, and a position.
To call a particular week's rankings you'd use a query like
SELECT item, position FROM rankings WHERE date = '2009-10-14' ORDER BY position DESC;