Hmm I've managed to solve part of my problem, basically I can return a list of all the entrants I require, however I am now returning the array in this format:
Array ( [5] => Array ( [0] => Array ( [name] => Retief Goosen ) [1] => Array ( [tee_off_time] => 0908+0100 ) [2] => Array ( [name] => Jeff Maggert ) [3] => Array ( [tee_off_time] => 0908+0100 ) )
Instead I want to return it like so:
Array ( [5] => Array ( [0] => Array ( [name] => Retief Goosen [tee_off_time] => 0908+0100 ) [1] => Array ( [name] => Jeff Maggert [tee_off_time] => 0908+0100 ) )
Code now looks like this:
while($row = mysql_fetch_assoc($sql_result)) {
// Populate array with unique groups
if(in_array($row['groupno'], $grouping) == false) {
$grouping[] = $row['groupno'];
}
foreach($grouping as $item){
if($row['groupno'] == $item){
$group = $row['groupno'];
$entrants[$group][]['name'] = $row['name'];
$entrants[$group][]['tee_off_time'] = $row['tee_off_time'];
}
}
}