$top = mysqli_query($link,"SELECT user_name, level FROM user WHERE level > 0 ORDER BY level DESC LIMIT 10");
while ($row = mysqli_fetch_array($top)) {;
message($user_id,'топ игроков<br>'.$row['user_name']);
}
die('OK')
<?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);