|if I may...
your first warning is that your are missing the 2nd argument in your function am_getlatestscores, which is $sql. This warning is being called from called in /home/myusername/public_html/cache/%%45^45E^45E480CD%%index.tpl.php on line 36. Open this php script and go to line 36 and look at how the $sql argument is built and passed. Also count your arguments you have 5 listed, but only the last 3 have default values. So you MUST have at least 2 arguments in the function call.
The foreach is expecting an array to be passed, and it is not present.
the 2 common usages of foreach is:
foreach($myArray as $value)
echo "Val: ".$value."
foreach($myArray as $key=>$value)
echo "Key:".$key." Val: ".$value."
given an array of...
$myArray = array(a,b,c);
The first foreach will produce...
The second foreach....
Key: 0 Val: a
Key: 1 Val: b
Key: 2 Val: c
So long story short, the value you have passed to your foreach is not an array.
looking back at your code...
$higharray = am_getlatestscores($db, 'none', 'list'); foreach ($higharray as $hhscore)
...try testing the $higharray variable...
It may be undefined, an empty string or FALSE.