Jump to content

scheduling


chriscloyd

Recommended Posts

i hvae a script where people can come to my site sign up and either create a team or join a team when an admin hits the button generate schedule i wanna be able to match each team up to 8 other teams and save all the information into my db can someoen help me get started
Link to comment
Share on other sites

Just randomize the teams not including the team you want to create matches for!

[code]SELECT tid, tname FROM teams WHERE tid != some_team_id ORDER BY RAND() LIMIT 8;[/code]

Then add those results to a [b]games[/b] table to create the games schedule. You can also add more logic to the above query, so you only select teams that are not already playing or that may have already played one another.

me!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.