id 1 in mysql must be team BYe as it says in comment inscript
// id 1 must be team name BYE
or the sql will need changing to reflect the id of the BYE team
this is here so that if only 3 teams the bye comes into play
to get the second lot of rounds change this bit
$round=rounds($matches[1],$teams,$games);
//$round[2]=rounds($matches[2],$teams,$games);
to
$round[1]=rounds($matches[1],$teams,$games);
$round[2]=rounds($matches[2],$teams,$games);
then rounds will have to elements containing the 2 seperate rounds one for home and one for array
note in my limited test of this script i found it did not complete when over 10 teams in db not including BYE
output 3teams and bye
Array
(
[1] => Array
(
[1] => Array
(
[0] => team C v team A
[1] => BYE v team B
)
[2] => Array
(
[0] => BYE v team A
[1] => team C v team B
)
[3] => Array
(
[0] => team B v team A
[1] => BYE v team C
)
)
[2] => Array
(
[1] => Array
(
[0] => team A v team C
[1] => team B v BYE
)
[2] => Array
(
[0] => team A v BYE
[1] => team B v team C
)
[3] => Array
(
[0] => team C v BYE
[1] => team A v team B
)
)
)