Not able to run this php code? :     <?PHP
    $connection = mysqli_connect("localhost", "akdnaklnd", "lfnlfns","faknfns");
    $game = $_POST['game'];
    $post_rating = $_POST['rating'];
    $find_data = mysqli_query( "SELECT * FROM rates WHERE game='$game'");
    while($row = mysqli_fetch_assoc($find_data)){
    $id=$row['id'];
    $current_rating = $row['rating'];
    $current_hits=$row['hits'];
    }
    $new_hits = $current_hits + 1;
    $update_hits= mysqli_query("UPDATE rates SET hits = '$new_hits' WHERE id='$id'");                                  
    $pre_rating= $current_rating + $post_rating;
    $new_rating = $pre_rating / $new_hits;
    $update_rating = mysqli_query("UPDATE rates SET rating ='$new_rating' WHERE     id='$id'");
    header("location : average.php");
    ?>
Discription I am trying to insert rating in database and calling average of that given rating from data base

