No array data from function
Posted: Fri May 15, 2009 9:07 pm
Hello everyone and thank-you in advance for any help/suggestions. I have been trying to improve some of my baseball web site code. I seem to be having problems with populating my multdimensional array in my function. Originally I did a while loop with mysql fetch. What I tried to do was first read all of the DB data into an array. Then I used a foreach loop with a function call inside to parse the data. Here is some of thecode:
If I echo before the function call Isee the data I want.
The function just doesn't do what it should. Can a function return a multidimensional array? Is the foreach function call the proper way to take my data array and produce my dynamic standings list?
TY
Cheers
Code: Select all
foreach($stats as $stat):
$standings=games($stat[0], $stat[1], $stat[2], $stat[3], $stat[4], $stat[5], $stat[6], $stat[7]);
endforeach;[Code: Select all
function games($vis, $home, $vis1, $home1, $vis2, $home2, $status1, $status2)
{
global $outcome, $overall, $standings, $team, $num_teams;
...
...
return ($standings);
}TY
Cheers