Skip to content
Snippets Groups Projects
Commit bac481b2 authored by Muhammad Umar Fariz Tumbuan's avatar Muhammad Umar Fariz Tumbuan
Browse files

Benerin bug driver votes: Mencegah pembagian dengan 0

parent 9b6eff4a
1 merge request!45OneHundred - 13515005 - Husnulzaki Wibisono Haryadi
......@@ -48,7 +48,12 @@
$getDriver = mysqli_fetch_assoc($query);
$driver_score = $getDriver['total_score'];
$driver_votes = $getDriver['votes'];
$rating = $driver_score / $driver_votes;
if ($driver_votes != 0) {
$rating = $driver_score / $driver_votes;
} else {
$rating = 0;
}
echo '<script>document.getElementById("driver_rating").innerHTML = '.$rating.';</script>';
echo '<script>document.getElementById("driver_votes").innerHTML = '.$driver_votes.';</script>';
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment