Hi All
I am tryin to place data into a html table. It has to be 3 columes long and show the top 10 players.
The headings will be: Player | Kills | Deaths
with the information placed under the heading.
This is what I have so far:
<?php
$username = "username";
$password = "password";
$hostname = "localhost";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Top 10 Players <br><br>"; // Means Connected to Database
//select a database to work with
$selected = mysql_select_db("battalion",$dbhandle)
or die("Could not select battalion");
//execute the SQL query and return records
$result = mysql_query("SELECT playerID, kills, deaths FROM vsp_playerprofile ORDER BY kills DESC");
echo "Players Name: "."Kills: "."Deaths: "."<br>";
echo "<br>";
//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
echo $row{'playerID'}." Kills: ".$row{'kills'}.$row{'skill'}." Deaths:".$row{'deaths'}."<br>"."<br>";
}
//close the connection
mysql_close($dbhandle);
?>
I have seen many ways to complete this, but a bit confussing, what would be the best way to complete this ?
Many thanks
Scorp (Newbie to this)