如何设置具有布尔值或存储在其中的测试分数的主题数组?
如果有人在一门学科的每项测试中都取得高分,我会尝试展示金牌。
我希望我可以更清楚地提出这个问题,但这里有一些代码可以帮助阐明:
$resTestsQryStr = "SELECT TestID, Subject FROM Tests
WHERE " . $edstr . " AND " . $plstr . " AND " . $levelStr . " GROUP BY Subject";
$resTests = mysql_query($resTestsQryStr);
while ($rowT=mysql_fetch_array($resTests))
{
$subject=$rowT['Subject'];
$tID=$rowT['TestID'];
$resScore= mysql_query("SELECT Score FROM CompletedTests WHERE UserNum = '$userNum' AND TestID = '$tID'");
$rowScore= mysql_fetch_array($resScore);
if ($rowScore['Score'] < 100){
$medalWinArray[$subject]= false;
break;
}
else
$medalWinArray[$subject]= true;
}