I am making a 8-ball pool ladder for my work, the system is going to be pretty straight forward.
We decided on a ladder based system with a 50% gain in position, so for example if I am rank 5 and I beat the player in rank 1 I move up to 3rd.
The way this is calculated I have already built, you can see this in action here: http://www.digital-inspired.co.uk/ladder/default.aspx
The bit I need help with is the database, consider the layout below:
This is an example of how my user table is going to look, I will then fire a stored procedure to return the list in asc order of the rank, what I am stuck on is updating of a persons rank.
So using the example I mentioned above, I would update my rank to 3rd but then need to update the previous rank 3 and 4 to move down 1.
Does anyone have an idea on how I do this? Or any advice on best practises etc ?
View Complete Post