我试图按照他们的成绩组打印出学生的柜台 如果我有三个学生 60 -65 然后打印出 60 -65
之间有多少学生如果我有两名学生 66 -70 然后打印出 66 -70
之间有多少学生等等.. 我想打印所有if语句的所有计数器。
<?php
$numberofstudents = mysqli_num_rows($result);
$counterA=0;
$counterB=0;
$counterC=0;
if ($grade >= 60 && $grade<=65)
{
$counterA=$numberofstudents;
$counterA++;
echo "<br />The number of falls by their grade group between 60 and 65 are : " . $counter6065 ;
}
if ($grade >=66 && $grade<=70)
{
$counterB=$numberofstudents;
$counterB++;
echo "<br />The number of students by their grade group between 66 and 70 are : " .
$counterB;
}
if ($grade >=71 && $grade<=75)
{
$counterC=$numberofstudents;
$counterC++;
echo "<br />The number of students by their grade group between 71 and 75 are : " . $counterC ;
}
?>
当我尝试打印$numberofstudents
正确显示时,我的代码无法正常工作
而counterA
增加$numberofstudents
中的任何值。
好吗?
由于