Code: Select all
<!--Written by Spawnfestis @ indie-resource.com! Free to use by all means!-->
<center>
<?php
include_once 'connect.php';
session_start();
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<?php
$result = mysql_query("SELECT * FROM `players` ORDER BY `exper` DESC LIMIT 0,25") or die("Could not get toplist information. Database error.");
$counter = 1;
echo "<table width='185' cellspacing='3' valign='top'>";
echo "<tr><td width='10'>#</td><td width='100'>Name</td><td width='25'>Level</td><td width='50'>Class</td><tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr><td width='10'>".$counter."</td>";
echo "<td width='100'>".$row['name']."</td>";
echo "<td width='25'>". $row['level']."</td>";
echo "<td width='50'>". $row['pclass']."</td></tr>";
$counter++;
}
echo "</table>";
?>
</center>
You can paste this into for example, toplist.php and just make a link in your game and it'll work magically.
From a game developer (to be, I have 6 months left, then I'm out to work

Cheers for giving me motivation to make an MMORPG although I didn't use much of the code from the tutorials, this community makes me strive for success.