<?php
$host = "provalgk.beget.tech";
$username = "provalgk_user";
$password = "Qwer123.";
$database = "provalgk_user";
$mysql = new mysqli($host, $username, $password, $database);
// Проверка соединения
if($mysql->connect_error){
    die("Ошибка подключения". $mysql->connect_error);
}
$query = "SELECT AVG(rating) AS average_value FROM reviews";
$result = $mysql->query($query);
$row = $result->fetch_assoc();
$average = $row['average_value'];
echo "$average";



?>