Skip to content

Instantly share code, notes, and snippets.

@iammerrick
Created October 21, 2010 17:12
Show Gist options
  • Save iammerrick/638880 to your computer and use it in GitHub Desktop.
Save iammerrick/638880 to your computer and use it in GitHub Desktop.
<?php
$past_months_total = DB::query(Database::SELECT, 'SELECT COUNT(*) as uploaded FROM `photos`
WHERE `photos`.`created`
BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY) AND NOW()
AND `photos`.`user_id` = '. $this->user->id)->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment