diff --git a/scripts/weekly_report.php b/scripts/weekly_report.php index b28ef2e..e625d3a 100644 --- a/scripts/weekly_report.php +++ b/scripts/weekly_report.php @@ -210,7 +210,11 @@ while($detection=$result1->fetchArray(SQLITE3_ASSOC)) $totalcount = $result2->fetchArray(SQLITE3_ASSOC); $priorweekcount = $totalcount['COUNT(*)']; - $percentagediff = round( (($scount - $priorweekcount) / $priorweekcount) * 100 ); + if ($priorweekcount > 0) { + $percentagediff = round( (($scount - $priorweekcount) / $priorweekcount) * 100 ); + } else { + $percentagediff = 0; + } if($percentagediff > 0) { $percentagediff = "+".$percentagediff."%";