[Dxspider-support] index.php
Dirk Koopman
djk at tobit.co.uk
Sun Oct 16 11:56:52 BST 2016
On 16/10/16 10:50, Allen via Dxspider-support wrote:
> <?php
>
> // Turn off all error reporting -> error_reporting(0);
> error_reporting(0);
>
> Function showSpots(){
>
> //Open the activation Database
> $con=mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
> // Check connection
> if (mysqli_connect_errno())
> {
> echo "Failed to connect to MySQL: " . mysqli_connect_error();
> exit();
> }
>
> // Only show last 8 hrs. 1 day = 86400 seconds (24 * 60 * 60))
> date_default_timezone_set('UTC');
> $curDate = date('Y-m-d H:i:s');
> $time = strtotime($curDate);
> $selDate = $time - 7200 ;
> $time = date('Y-m-d H:i:s',$selDate);
>
> // Must be Ok if got this far so read table
> // $sql="SELECT * FROM activations WHERE actTime > '". $time . "'
> ORDER by actTime Desc";
> $sql="SELECT * FROM activations WHERE (actTime > '". $time . "'
> AND actTime < '" . $curDate . "') ORDER by actTime Desc";
> $result = mysqli_query($con,$sql);
> if (!$result)
> {
> die('Error: ' . mysqli_error($con));
> }
>
Etc.
This is interesting, but some explanation or comment about it would be
useful
Dirk
More information about the Dxspider-support
mailing list