chriscloyd Posted October 11, 2006 Share Posted October 11, 2006 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 https://forums.phpfreaks.com/topic/23632-scheduling/ Share on other sites More sharing options...
printf Posted October 11, 2006 Share Posted October 11, 2006 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 https://forums.phpfreaks.com/topic/23632-scheduling/#findComment-107339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.