Heres what I did:
I made a game to pick the winners and find out potential heat draws (match ups) for surf contests. Basically, in round 1 there are 3 man heats and you pick one winner for each heat. The winner goes straight into round 3, and the 2 losers go into round 2. Then in round 2, there are 2 man heats where the winner goes into round 3 and the loser is eliminated. Based on your round 1 choices, the round 2 heat draw is calculated (heat draws are calculated by the surfers seed number (rankings).. ex: heat 1 is #10 vs #26 vs #39). And based on your round 2 choices, the round 3 heat draw is calculated.
Anyways, I have it working right now like this:
My database is set up where I have fields: surfer name, seed number (ranking), round 1, round 2, round 3. In round 1, if the surfer is competing in the event, the value is set to '1', if not, it's set to '0'. So, for round 1, first I reset all surfers round 2 and 3 values to '0'. Then, I call all the surfers with round 1 set to '1', sort them ASC according to their seed number and put them into a variable containing an array. From the array, I put them into their correct heats. On submit, When you pick your winners, that basically sets their round 3 = '1'.
When the round 2 page is loaded, I have scripting that first sets all surfers round 2 values = '1'. Then it gets all the surfers with round 3 values = '1' (your picked winners) and changes their round 2 = '0'. So it then gets the round 2 guys with '1', sorts them ASC and puts them into an array and from the array I put them into their respective heats. Then you pick your round 2 winners, and on submit, the winners round 3 = '1'. For the round 3 page, it calls all surfers with round 3='1', sorts them ASC, puts them into an array and distributes them into their respective heats for the final round 3 heat draw.
The problem:
Because of the way I have it set up, it only works for 1 person playing at a time. If I am playing and picking winners, its changing their values in the database. So if someone else tries to pick their winners, it's all screwed up. How can I get this going to where the client side is able to get the seed numbers from the database and things are manipulated client-side and heat draws are calculated that way? Any ideas?
Thanks guys, sorry for the newbie question.