<?php
$servername = "localhost";
$username = "mysql";
$password = "mysql";
// Create connection
$conn = new mysqli($servername, $username, $password, "test");
$top = mysqli_query($conn,"SELECT user_name, level FROM user WHERE level > 0 ORDER BY level DESC LIMIT 10");
$res = $top->fetch_all();
echo "<pre>";
print_r($res);