Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- // MySQL database connect details.
- $username="DBUSER";
- $password="i hope u can do it :P";
- $database="db_name";
- $host="chuck norris XD";
- // MySQL connection.
- $connection = mysql_connect($host,$username,$password);
- @mysql_select_db($database) or die( "Unable to select database. Be sure the databasename exists and online is.");
- $query="SELECT `UserID`,`Playername`,`Kills`,`Deaths` FROM users LIMIT 0,50";
- $query = mysql_query($query);
- echo('<table width="300" border="2" cellspacing="3" cellpadding="3">
- <tr>
- <td style="min-width:150px;">Playername:</td>
- <td style="width:100px">Kills:</td>
- <td style="width:100px">Deaths:</td>
- <td style="width:100px">Ratio:</td>
- </tr>');
- while($row = mysql_fetch_assoc($query))
- {
- $id = $row['UserID'];
- $playername = $row['Playername'];
- $kills = $row['Kills'];
- $deaths = $row['Deaths'];
- $ratio = ($kills/$deaths);
- $fratio = ceil($ratio);
- echo('
- <tr>
- <td style="min-width:150px;"><a href="stats.php?id='.$id.'">'.$playername.'</a></td>
- <td style="width:100px">'.$kills.'</td>
- <td style="width:100px">'.$deaths.'</td>
- <td style="width:100px">'.$fratio.'</td>
- </tr>');
- }
- echo('</table>');
- mysql_close($connection);
- ?>
Add Comment
Please, Sign In to add comment