Hi there, I realised I was being a bit of a noob. It wasn't working because I was taking the last line exactly (e.g. $ID = $row->team_id;) instead i replaced it with $GF = $row['SUM(goals_scored)']; (from the Goals For query).
As soon is I changed it the query works fine every time it was exactly how you said the queiries weren't holding any values.
Any way thanks a lot for all your help it is very much appreciated, now I will be able to continue programming and use this in future queries.