I everyone,
I am running the following code:
<?php
$total = 0;
if ($total > 0); {
$average = $sum/$total;
echo "Sum: $sum / Total: $total"; }
?>
When I try to tun the code I get the following error:
Warning: Division by zero in /home/superman/public_html/comics/comicvote.php on line 14
I understand that division by 0 is not allowed, but shouldn't the if statement prevent that division from running?
Thanks.