Hi Sivapatham and welcome to DaniWeb,
A very simple algorithm for this would be:
for( $i = 0; $i < $n; $i++ ) // if $n is number of teams
{
for( $j = $n-1; $j > $i; $j-- )
{
// teams for this match have id's = $i and $j
// I'll let you work out what you want to do here...
}
}
I am sure there is a more efficient way of doing this, but this algorithm should work.
darkagn
Nearly a Posting Virtuoso
1,223 posts since Aug 2007
Reputation Points: 404
Solved Threads: 211
Skill Endorsements: 15
pritaeas
Posting Prodigy
9,293 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,462
Skill Endorsements: 86