Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
schedule players for a league saideep2007 msg:4249707 6:58 am on Jan 6, 2011 (gmt 0) Hi all, I need to create a schedule for the players from Mysql database who are participating in the tennis league See for example i have 5 players in the league the 5 players should play match against each other e.g 1.Player A 2.Player B 3.Player C 4.Player D 5.Player E The player should play every match against the member in league so can u help wid some code or and idea... i'm not at all geting any idea how to schedule them Waiting for u r reply Regards saideep.K
rocknbil msg:4249903 4:51 pm on Jan 6, 2011 (gmt 0)
I would think you'd start with the schedules first. id int(11) | game_name (varchar) | game_date (datetime) Then if there are multiple players for a match, you'd have a table that holds that information, which could be updated with a score for each player. No need to store "winner," that would be determined by the score. Store the players by their ID, not full name, it will make lookups faster. id (int(11) | player_a (int) | player_b (int) | player_a_score (int) | player_b (int) | challenged_by (int) | status (tinyint; 1=accepted, 2=declined, etc.) | notes (text) Now you'd have the players. id (int(11) | fname (varchar) | lname(varchar) | city (varchar) | province_state (varchar) | phone | address | profile . . . whatever info you want to store here Using these three, you could - show available games and players who are not matched against the current player for a challenge - Set up a system of challenge/accept/decline - query for pending games or historic results Probably pieces missing, but it's a start.