Jump to content
xisto Community
Sign in to follow this  
Antv912

[php] Rankings Something I made for my MapleStory server

Recommended Posts

<?php$con = mysql_connect("localhost","root","");if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db("maplestory", $con);$result = mysql_query("SELECT * FROM Characters ORDER BY Level DESC");echo "<table border='1'><tr><th>Name</th><th>Level</th><th>Exp</th></tr>";while($row = mysql_fetch_array($result))  {  echo "<tr>";  echo "<td>" . $row['name'] . "</td>";  echo "<td>" . $row['level'] . "</td>";  echo "<td>" . $row['exp'] . "</td>";  echo "</tr>";  }echo "</table>";mysql_close($con);?>

So easy even a Caveman could do it!


$con = mysql_connect("localhost","root","");Host,Username,Password

echo "<td>" . $row['name'] . "</td>";  echo "<td>" . $row['level'] . "</td>";  echo "<td>" . $row['exp'] . "</td>";

$row['xxx']
- Is a row the script echo's from the database

And must match this :
<th>Name</th><th>Level</th><th>Exp</th>

Example

<th>1</th><th>2</th><th>3</th>

This must be ..
echo "<td>" . $row['1'] . "</td>";   echo "<td>" . $row['2'] . "</td>";   echo "<td>" . $row['3'] . "</td>";

You can save this file as Rankings.php
Edited by Antv912 (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.