Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function addzero($x)
- {
- if ($x<10)
- return '0'.$x;
- else return $x;
- }
- function nextpoints()
- {
- //settings
- $host = 'logon.wow-hazzard.com';
- $username = 'admin';
- $password = '';
- $database = 'characters';
- $table = 'saved_variables';
- //////////
- $sql = mysql_connect($host,$username,$password);
- if (!$sql)
- {
- return 'Error: Could no connect to database.';
- }
- else
- {
- mysql_select_db($database,$sql);
- $stampquery = mysql_query("SELECT * FROM $table");
- while ($stamparray = mysql_fetch_array($stampquery))
- $timestamp = $stamparray['NextArenaPointDistributionTime'];
- $timearray = getdate($timestamp);
- //to prevent 01:01 showing as 1:1
- $minutes = addzero($timearray[minutes]);
- $hours = addzero($timearray[hours]);
- $mday = addzero($timearray[mday]);
- $mon = addzero($timearray[mon]);
- /////////////////////////////////
- echo "<b>$timearray[weekday] $hours:$minutes [GMT +2] [$mday.$mon.$timearray[year]]<b>";
- mysql_close($sql);
- }
- }
- nextpoints();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement