Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

schedule players for a league

6:58 am on Jan 6, 2011 (gmt 0)

New User

5+ Year Member

joined:Feb 28, 2009
posts: 24
votes: 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

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

4:51 pm on Jan 6, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 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.