Quote:
Originally Posted by ericgtr
I tried changing the query to this which is partially borrowed from PaulM's code and should show who has registered since midnight:
and I get the exact same results as I do with my code.
|
Hmm, I doubt you do, not with what you have posted anyway.
This should work ;
PHP Code:
// Who Regeistered Today - using Paul Marsden's code
$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now, false, false), vbdate('d', $now, false, false), vbdate('Y', $now, false, false));
// $cutoff = $now - 86400 ; // Uncomment this line if you want a rolling last 24 hours.
$newusers = $DB_site->query_first('
SELECT COUNT(*) AS count
FROM ' . TABLE_PREFIX . 'user
WHERE joindate >= ' .$cutoff. '
');
$newmembers = number_format($newusers['count']);
// Who Regeistered Today - using Paul Marsden's code
Edit: Updated with bug fixes from subsequent posts.