Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2. $host = "sql";
  3. $user = "39640";
  4. $pass = "asdf1234";
  5. $users = "39640";
  6. $con = mysql_connect($host,$user,$pass) or die (mysql_error());
  7. $border = 0;
  8. $hanyember = 10;
  9.  
  10. function getTime($total)
  11. {
  12.   $day = (int)($total/86400);
  13.   $total = $total - ($day*86400);
  14.   $hour = (int)($total/3600);
  15.   $total = $total - ($hour*3600);
  16.   $minute = (int)($total/60);
  17.  
  18.   $time = $day." nap ".$hour." óra ".$minute." perc";
  19.   return $time;
  20. }
  21.  
  22. $query = mysql_query("SELECT `username`, `current_balance` FROM `".$users."`.`users` ORDER BY `current_balance`") or die (mysql_error());
  23. $numrows = mysql_num_rows($query);
  24. $i = 0;
  25.  
  26. echo "<table border='" . $border . "'>";
  27. echo "<tr>";
  28. echo "<td>";
  29. echo "Név";
  30. echo "</td>";
  31. echo "<td>";
  32. echo "<td>";
  33. echo "<td>";
  34. echo "Kapott";
  35. echo "</td>";
  36. echo "</tr>";
  37. //End
  38.  
  39. while($i < $numrows)
  40. {
  41. if($i+1 == $hanyember)
  42. break;
  43. $nev = mysql_result($query, $i, 0);
  44. $ido = mysql_result($query, $i, 3);
  45.  
  46. $i += 1;
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement