This is best illustrated with an example:
Chart Position Visitor Position Song ------------------------------------------------------- 1 10 Insomnia 2 1 Enter Sandman 3 2 Bad Moon Rising 4 5 Sunchyme 5 3 Beautiful Stranger 6 4 One 7 6 Wild Thing 8 9 Answer the Phone 9 7 Feel It 10 8 Can't get enough...So, visitors to the site vote for their favourite song by selecting it from a menu somewhere. I can't believe this simple thing is so difficult to code.
I have a plain text file for each song which contains the 'fixed position', i.e. the chart position, and the current visitors' position. When a user votes, the relevant file is opened, and the visitor position incremented.
I've tried using different arrays, but I can't sort them both in the same way as they get "out of sync". So I tried using a hash like $song{$chart_position}{$name}, but I couldn't figure the sorting out. (It should be in order of the chart position).
I'm really going mad trying to figure this out, so I'd appreciate any help.
(Please do not suggest using a database or something, I just really want to keep this simple)
In reply to Fixed 'Top 10' compared with visitors' Top 10 by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |