Forum Moderators: coopster
<html>
<head>
</head>
<body>
<?php
$con = mysql_connect ("user.site.nfoservers.com","user","password");
if (!$con){
die("Can not connect: " . mysql_error());
}
mysql_select_db ("user_nmrihstats", $con);
//query
$query = mysql_query("SELECT steam_id, name, points, kills, deaths from nmrihstats", $con);
//write the results
echo "<table border=1>
<tr>
<th>Name</th>
<th>Steam ID</th>
<th>Points</th>
<th>Kills</th>
<th>Deaths</th>
</tr>";
while ($row = mysql_fetch_array($query)) {
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['steam_id'] . "</td>";
echo "<td>" . $row['points'] . "</td>";
echo "<td>" . $row['kills'] . "</td>";
echo "<td>" . $row['deaths'] . "</td>";
echo "</tr>";
}// close the loop
echo "</table>";
mysql_close($con);
?>
</body>
</html>
[edited by: phranque at 9:48 pm (utc) on Mar 24, 2014]
[edit reason] anonymized db connection data [/edit]