[英]PHP Warning :Division by zero
When I try to see my average scores for my table labeled tools, I keep getting this error Warning: Division by zero in /home/xxxxx/xxxxx/Exercise5/showResults_step7.php on line 167 SUM for CSS: and AVE = nan当我尝试查看标记为工具的表格的平均分数时,我不断收到此错误警告:在 /home/xxxxx/xxxxx/Exercise5/showResults_step7.php 的第 167 行 SUM 中除以零:和 AVE = nan
I changed the name of my project with XXXX's for confidential reasons出于保密原因,我将项目名称更改为 XXXX
My lecture video had my professor doing this same things as I did below so I do not see why I am getting this error我的讲座视频让我的教授做了我在下面做的同样的事情,所以我不明白为什么我会收到这个错误
echo ' SUM for CSS: '. echo ' CSS 的总和:'。 $firstrow[0].
$第一行[0]。 ' and AVE = '.
' 和 AVE = '。 number_format($firstrow[0] / $rows, 2).
number_format($firstrow[0] / $rows, 2)。 '
'
'; '; echo ' SUM for Filezilla: '.
echo 'Filezilla 的总和:'。 $firstrow[1].
$第一行[1]。 ' and AVE = '.
' 和 AVE = '。 number_format($firstrow[1] / $rows, 2).
number_format($firstrow[1] / $rows, 2)。 '
'
'; '; echo ' SUM for HTML: '.
echo ' HTML 的总和:'。 $firstrow[2].
$第一行[2]。 ' and AVE = '.
' 和 AVE = '。 number_format($firstrow[2] / $rows, 2).
number_format($firstrow[2] / $rows, 2)。 '
'
what's the value of $rows in line 167?第 167 行中 $rows 的值是多少?
echo ' SUM for CSS: ' . $firstrow[0] . ' and AVE = ' . number_format($firstrow[0] / $rows, 2) // <= ¿whats the value of $rows here?
cause if it's 0 that could be the problem.因为如果它是0,那可能是问题所在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.