<?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 900) tbl"; 
$result=mysqli_query($con,$query);

$row3=mysqli_fetch_assoc($result);

mysqli_close($con);
?>

<?php echo round($row3['rate'],0); ?>