Hi there
Ive got a couple of solutions to this problem, but neither seem very elegant and was wondering if there is an easier way to go about it.
Ive got a db which holds scores for all my members, the higher the score the better. At the moment I am showing a "top ten" on the front page, which is worked out dynamically when the page is shown (basically go through all the members, get current score, put into array, sort the array).
Now what I am wanting to do is to put little arrows next to the names and scores of the members, to show if they have moved up or down after each new game is submitted, and the new scores worked out.
Now my thoughts on this are:
a) have 2 extra fields in the members db (current position, and movement). When a new game is added, work out the new position for everyone, and see if that position is higher or lower than the current one (or the same) and change the 'movement' field to either u,s or d (up, same or down, syntax is unimportant). Then when I display the name I can also check this field to show what arrow to show.
Is this the easiest way? Of course this way would also lead to me not having to work out top ten dynamically when the page is shown, as it would already be held in the db ....
Thanks in advance
Nick