<?php
include 'config.php';

$sql="SELECT * FROM users ORDER BY users.total_paid DESC LIMIT 20";
$result=mysqli_query($conn,$sql);

if($result){
$json_array=array();
while($row=mysqli_fetch_assoc($result))
{
    $json_array[]=$row;
}
echo json_encode($json_array, JSON_UNESCAPED_UNICODE);
}
else{
echo 'No User Found';
}
?>