Help With Update

From: Date: Wed, 03 Jan 2001 02:45:42 +0000
Subject: Help With Update
Groups: php.general 
Request: Send a blank email to php-general+get-32455@lists.php.net to get a copy of this message
Hi, I need some specific code help with update. I am running an online backgammon league. I'm trying to figure out how to create a script that would, when initiated, update the Placement, Division and Score of all Players. The players are in Divisions 1,2,3,3a,4a,4b and 4c. At the end of a certain date, it becomes necessary to Update the placement of all players in league. This is a Very tedious and time consuming process when done manually. I figured with php/mysql it could be done, I just don't possess the knowledge. The Rules in effect are as follows. The Top Player in Division 1 is deemed the Winner, the middle people just remain in Division 1 Bottom 4 players in Division 1 will drop to Division 2. Top 4 players from Division 2 will move up to Division 1. The Middle people in Div 2, stay there Bottom 4 players from Division 2 will drop to Division 3. Top 2 players from Division 3a and Top 2 players from Division 3b will move up to Division 2. The Middle people in Divisions 3a and 3b, stay there Bottom 4 players from Division 3a will drop to a subdivion of 4 (a,b,c or d) Bottom 4 players from Division 3b will drop to a subdivion of 4 (a,b,c or d) Top 8 players from Sub divisions of 4 will move up to Division 3a and 3b, 4 each. All others will remain in that division. Also at the end of regular league session if there are more than 4 people tied to move up to next higher division a playoff is required to find out which 4 move up. So I'd like those tied players to appear in another table with their division title and the pairings of who needs to play who. Each Match Won, gets a player 10 points. At the end of league is where the amount of points determines who moves up or down the divisions. Here is what the Table looks like where submitted matches are stored and its also where I use scripts to total up peoples wins etc. Field Type Attributes Null Default Extra Action Winner varchar(25) No Change Drop Primary Index Unique Loser varchar(25) No Change Drop Primary Index Unique Wins tinyint(4) No 0 Change Drop Primary Index Unique Losses tinyint(4) Yes Change Drop Primary Index Unique ID int(150) No 0 auto_increment Change Drop Primary Index Unique Division char(3) Yes Change Drop Primary Index Unique Submitted varchar(30) Yes Change Drop Primary Index Unique Keyname Unique Field Action ID No ID Drop PRIMARY Yes ID Drop When the records are updated, I would need the Wins field for everyone to be set to 0, unless they are tied for playoffs. The updates would also need the divisions for each person to change to refelct their movement. As I'm writing this, it is seeming impossible to write a script to do these things, is it? I appreciate anyones help with this matter. Thanks, Rhyan

« previous php.general (#32455) next »