Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $user = "root";
- $pass = "";
- $characters = "characters"; //Karakter adatbázis neve.
- $con = mysql_connect($host,$user,$pass) or die (mysql_error());
- $border = 0;
- $hanyember = 10;
- $query = mysql_query("SELECT `name`, `class`, `race`, `totalHonorPoints` FROM `".$characters."`.`characters` ORDER BY `totalHonorPoints`") or die (mysql_error());
- $numrows = mysql_num_rows($query);
- $i = 0;
- //Printing the upper part of the table
- echo "<table border='" . $border . "'>";
- echo "<tr>";
- echo "<td>";
- echo "Név";
- echo "</td>";
- echo "<td>";
- echo "Class";
- echo "</td>";
- echo "<td>";
- echo "Race";
- echo "</td>";
- echo "<td>";
- echo "Honor";
- echo "</td>";
- echo "</tr>";
- while($i < $numrows)
- {
- if($i+1 == $hanyember)
- break;
- $nev = mysql_result($query, $i, 0);
- $class = mysql_result($query, $i, 1);
- $race = mysql_result($query, $i, 2);
- $honor = mysql_result($query, $i, x);
- echo "<tr>";
- echo "<td>";
- echo $nev;
- echo "</td>";
- echo "<td>";
- echo $class;
- echo "</td>";
- echo "<td>";
- echo $race;
- echo "</td>";
- echo "<td>";
- echo $honor;
- echo "</td>";
- echo "</tr>";
- $i += 1;
- }
- echo "</table>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement