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
I changed the name of my project with XXXX's for confidential reasons
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: '. $firstrow[0]. ' and AVE = '. number_format($firstrow[0] / $rows, 2). '
'; echo ' SUM for Filezilla: '. $firstrow[1]. ' and AVE = '. number_format($firstrow[1] / $rows, 2). '
'; echo ' SUM for HTML: '. $firstrow[2]. ' and AVE = '. number_format($firstrow[2] / $rows, 2). '
what's the value of $rows in line 167?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.