<?php
include("../../dbinfo.php");

$con=mysqli_connect($host,$username,$password,$database);
$query = "SELECT AVG(wtonshr) AS rate FROM (SELECT wtonshr FROM milling ORDER BY id DESC LIMIT 600) tbl"; 
$result=mysqli_query($con,$query);

$roww24hravg=mysqli_fetch_array($result, MYSQLI_ASSOC);

mysqli_close($con);

echo round($roww24hravg['rate'],0)*24;
?>