Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "sql";
- $user = "39640";
- $pass = "asdf1234";
- $users = "users";
- $con = mysql_connect($host,$user,$pass) or die (mysql_error());
- $border = 0;
- $hanyember = 10;
- function getTime($total)
- {
- $day = (int)($total/86400);
- $total = $total - ($day*86400);
- $hour = (int)($total/3600);
- $total = $total - ($hour*3600);
- $minute = (int)($total/60);
- $time = $day." nap ".$hour." óra ".$minute." perc";
- return $time;
- }
- $query = mysql_query("SELECT `username`, `current_balance` FROM `".$users."`.`users` ORDER BY `current_balance`") or die (mysql_error());
- $numrows = mysql_num_rows($query);
- $i = 0;
- echo "<table border='" . $border . "'>";
- echo "<tr>";
- echo "<td>";
- echo "Név";
- echo "</td>";
- echo "<td>";
- echo "<td>";
- echo "<td>";
- echo "Kapott";
- echo "</td>";
- echo "</tr>";
- //End
- 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);
- $ido = getTime(mysql_result($query, $i, 3));
- echo "<tr>";
- echo "<td>";
- echo $nev;
- echo "</td>";
- echo "<td>";
- echo $class;
- echo "</td>";
- echo "<td>";
- echo $race;
- echo "</td>";
- echo "<td>";
- echo $ido;
- echo "</td>";
- echo "</tr>";
- $i += 1;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement