Thanks for the suggestions...thought there might be something easier than writing some sort of recursive function, but with your suggestions I cobbled together something that works:
ECHO "EMPTY DATA SHEET CHECK.<BR>";
foreach($_SESSION['roomspicked'] as $sheet=>$number)
{ECHO "DATA SHEET: $sheet<BR>";
$itemcount=count(array_keys($DATA[$sheet]));
foreach ($DATA[$sheet] as $item=>$resp)
if ($resp[ANSWER]=='') {$answ[$sheet][]='(blank)';} else {$answ[$sheet][]="$resp[ANSWER]";}
$TEMP=array_count_values($answ[$sheet]);
$temp2=$TEMP['(blank)'];
ECHO "$itemcount items vs $temp2 blank answers: ";
if ($temp2 < $itemcount) {ECHO "Save record.";} else {ECHO "Skip record (do not save).";}
ECHO "<BR>";
}
(If you want to know the background...the sending form will have multiple columns (the "sheet" dimension) for rating several classrooms on various dimensions all at once. And if, for example, one or more of the rooms were not rated, there would be no need to save the record for those rooms. The itemcount is the number of items on which each room can be rated. If the number of blanks equals the number of items...no need to save the record because no data was provided.)
The output looks like this:
EMPTY DATA SHEET CHECK.
DATA SHEET: 1
60 items vs 60 blank answers: Skip record (do not save).
DATA SHEET: 2
60 items vs 59 blank answers: Save record.
DATA SHEET: 3
60 items vs 58 blank answers: Save record.
This will actually be used to tell the script whether or not to do the mysql insert.
Thanks a bunch.