总结名为salary的列的数据

时间:2017-12-11 17:50:37

标签: php undefined

汇总列的数据

以下是问题的代码段

            if(!empty($row_Recordset3['event'])){
                $total1= 1;
                if(!empty($row_Recordset3['event2'])){
                    $total2 = 1;
                    //$total1 = $total1 + $total2;
                    if(!empty($row_Recordset3['event3'])){
                        $total3 = 1;
                        $total1 = $total1 + $total2 + $total3;
                    }else{
                        $total3 = 0;
                        $total1 = $total1 + $total2 + $total3;
                    }
                }else{
                    $total2 = 0;
                    //$total1 = $total1 + $total2;
                    if(!empty($row_Recordset3['event3'])){
                        $total3 = 1;
                        $total1 = $total1 + $total2 + $total3;
                    }else{
                        $total3 = 0;
                        $total1 = $total1 + $total2 + $total3;
                    }
                }
            }else{
                $total1= 0;
                if(!empty($row_Recordset3['event2'])){
                    $total2 = 1;
                    //$total1 = $total1 + $total2;
                    if(!empty($row_Recordset3['event3'])){
                        $total3 = 1;
                        $total1 = $total1 + $total2 + $total3;
                    }else{
                        $total3 = 0;
                        $total1 = $total1 + $total2 + $total3;
                    }
                }else{
                    $total2 = 0;
                    //$total1 = $total1 + $total2;
                    if(!empty($row_Recordset3['event3'])){
                        $total3 = 1;
                        $total1 = $total1 + $total2 + $total3;
                    }else{
                        $total3 = 0;
                        $total1 = $total1 + $total2 + $total3;
                    }

                }

            }

            $total4 = $total1 * 10;
            $total5 += $total4; //here is the problem i think       

还是新的,如果代码效率不高,请修改

输出存在,​​但输出中仍显示错误。

注意:未定义的变量:第442行的C:\ xampp \ htdocs \ S.T.E.M \ account.php中的total5

总计= RM 80

0 个答案:

没有答案