按他们的成绩php计算失败学生的数量

时间:2014-10-01 10:54:21

标签: php

我试图按照他们的成绩组打印出学生的柜台 如果我有三个学生 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中的任何值。 好吗?

由于

0 个答案:

没有答案