Advertisement
Guest User

Untitled

a guest
May 16th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <?php
  2. function addzero($x)
  3. {
  4. if ($x<10)
  5. return '0'.$x;
  6. else return $x;
  7. }
  8. function nextpoints()
  9. {
  10. //settings
  11. $host = 'logon.wow-hazzard.com';
  12. $username = 'admin';
  13. $password = '';
  14. $database = 'characters';
  15. $table = 'saved_variables';
  16. //////////
  17. $sql = mysql_connect($host,$username,$password);
  18. if (!$sql)
  19. {
  20. return 'Error: Could no connect to database.';
  21. }
  22. else
  23. {
  24. mysql_select_db($database,$sql);
  25. $stampquery = mysql_query("SELECT * FROM $table");
  26. while ($stamparray = mysql_fetch_array($stampquery))
  27. $timestamp = $stamparray['NextArenaPointDistributionTime'];
  28. $timearray = getdate($timestamp);
  29. //to prevent 01:01 showing as 1:1
  30. $minutes = addzero($timearray[minutes]);
  31. $hours = addzero($timearray[hours]);
  32. $mday = addzero($timearray[mday]);
  33. $mon = addzero($timearray[mon]);
  34. /////////////////////////////////
  35. echo "<b>$timearray[weekday] $hours:$minutes [GMT +2] [$mday.$mon.$timearray[year]]<b>";
  36. mysql_close($sql);
  37. }
  38. }
  39. nextpoints();
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement