Example #1
0
 public function __construct()
 {
     $this->db = \Linkadept\Misc::getDatabaseObj();
     $this->errors = array('error' => false, 'messages' => array());
     $this->groupKey = '';
     $this->uploadedLinks = array();
 }
Example #2
0
<?php

$db = \Linkadept\Misc::getDatabaseObj();
$q = $db->prepare('INSERT INTO group_stats_ips_archive (
    group_stats_ips_archive.group_key,
    group_stats_ips_archive.visited_ip,
    group_stats_ips_archive.date)
    SELECT
    group_stats_ips.group_key,
    group_stats_ips.visited_ip,
    group_stats_ips.date
    FROM
    group_stats_ips
    WHERE
    group_stats_ips.date< DATE_SUB( utc_timestamp(), INTERVAL 1 DAY );');
$q->execute();
$q = $db->prepare('DELETE FROM group_stats_ips WHERE group_stats_ips.date < DATE_SUB( utc_timestamp(), INTERVAL 1 DAY );');
$q->execute();