I have a table called pvpstats. It has 4 columns; id, name, kills and deaths. I have to get 3 highest values from "kills" and sort them from highest to lowest and include also the name. Like 3-top statistics! And because I'm new with MySQL I need an step-by-step quide...
This is how my .php looks at the moment:
<?php
$server = "localhost";
$dbuser = "usernm";
$dbpass = "passwd";
$dbname = "pvpstats";
mysql_connect($server, $dbuser, $dbpass);
mysql_select_db($dbname);
$result = mysql_query("SELECT kills FROM pvpstats ORDER BY kills DESC LIMIT 3");
$row = mysql_fetch_assoc($result);
echo print_r($row,true);
?>
Connection is working and it is showing the highest value but without name. And only the highest when it should show 3 highest