I started this tread in the DATABASE section but am now trying to solve the problem with some type of multi-dimensional array search/parsing.
I need to find kids (based on ID numbers) who have complete sets of test scores (SCORE) for each of n SEASONS.
I extract the SCORES data from a MySQL query into a multidimensional array called $SCORE_ARRAY
$SCORE_ARRAY[ID][SEASON]
When I fetch the array, I can also create single-dimension array to give me just the complete set of student IDs all the SEASON names.
ie.
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$SCORE_ARRAY[$line[SEASON]][$line[ID]] = $line[SCORE];
$SEASONS[$line[SEASON]] = $line[SEASON];
$KIDS[$line[ID]] = $line[ID];
}
All the data seems to go into $SCORE_ARRAY just fine, but I want to ... in a sense... query the array to end up with with a subset exracted from $SCORE_ARRAY (say, $MATCHED_SCORES) that has filtered out all the rows for kids who are missing scores in one or more of the SEASONS.
I feel like I'm getting close here, but am not quite sure how to proceed. It seems like array_intersect would help, but I'm not sure how to apply it here.
Thanks for your help.