Actually, I can't release this until I get this query right. What it's supposed to do is grab how many times a file has been downloaded in the last 24 hours. If any of you guru's can help with this that would be great. As it is, I have nothing to compare it with but I can tell that it's parsing out the wrong numbers because it's declining as the day goes on.
Code:
$todays_views = $DB_site->query_first('
SELECT COUNT(*) AS count
FROM ' . TABLE_PREFIX . 'attachment
WHERE dateline >= "' . strtotime("-1day") . '"
');
$newhits = number_format($todays_views ['count']);