05.05.2016, 09:56
Hello!
I'm trying to make a top 10 list based on the kills a player has made but I just don't seem to make it work,so basically when i reload the page nothing shows up on it.
I'm a beginner at MySQL and PHP so I am asking for your help here.
This is the code I came up with (Note that I am not experienced with MySQL):
I'm trying to make a top 10 list based on the kills a player has made but I just don't seem to make it work,so basically when i reload the page nothing shows up on it.
I'm a beginner at MySQL and PHP so I am asking for your help here.
This is the code I came up with (Note that I am not experienced with MySQL):
PHP Code:
<?php
$handle = new PDO('mysql:dbname=rgamersc_minigames;host=localhost', 'database', 'password');
$results = mysql_query ('SELECT Username FROM player_accounts ORDER BY Kills DESC LIMIT 10');
while ($row = mysql_fetch_array($results))
{
echo $row['Username'];
echo "shit";
}
?>