Hi;
Well I'm starting to have a little bit of a conceptual understanding of arrays and keys and accessing array elements...so now I want to complicate my life even further.
I want to fill a two-dimensional array with the results of a query. I suppose this means some kind of nested loop?
Say I've got a bunch of test scores. Some were gotten in Fall, some in Winter and some in Spring.
So I write a query that gets the score from the MySQL table:
$Query="Select SEASON, SCORE from TableName Order By SCORE"
(I'm leaving all the connection and Link stuff out for the sake of brevity here...that I believe I understand well enough now).
I want the SEASON field to correspond to the first key in the array and the second key to point to a specific SCORE for each season.
I imagine this will be part of the code:
while ($Row=mysql_fetch_array($Result)) {
$ScoreArray[] = $Row[SCORE];
}
But I don't quite get how to get the SEASON in there.
Note: I'll be perfectly happy at this point to use the default [0][0]...[$n][$n] key values that php (or MySQL?) supplies when generating an array, just to keep the coding simple.