Помогите, что я сделал не так?
$day = date('d', TIME);
$month = date('m', TIME);
$year = date('Y', TIME);
$today = strtotime($day.'-'.$month.'-'.$year.' 00:00:00');
$week = strtotime(($day - 7).'-'.$month.'-'.$year.' 00:00:00');
$yesterday = strtotime(($day - 1).'-'.$month.'-'.$year.' 00:00:00');
$yesterday_end = strtotime(($day - 1).'-'.$month.'-'.$year.' 23:59:00');
$views_today = $db->query('SELECT COUNT(*) FROM '.TABLE_SITES_VIEWS.' WHERE `time` >= '.$today)->fetch(PDO::FETCH_NUM);
$views_week = $db->query('SELECT COUNT(*) FROM '.TABLE_SITES_VIEWS.' WHERE `time` >= '.$week)->fetch(PDO::FETCH_NUM);
$views_yesterday = $db->query('SELECT COUNT(*) FROM '.TABLE_SITES_VIEWS.' WHERE `time` >= '.$yesterday.' AND `time` <= '.$yesterday_end)->fetch(PDO::FETCH_NUM);