Status
Not open for further replies.

DeLeTeD

Active Member
3,591
2009
9
0
Well I created this code rather fast. I just can't seem to make it get the correct number results. I know I am over looking something small.

PHP:
$newusers = $db->query_first('
SELECT COUNT(*) AS count 
    FROM ' . TABLE_PREFIX . 'user
    WHERE joindate >= "' . strtotime("-1day") . '"
');
$newmembers = number_format($newusers['count']);



$newposts = $db->query_first('
SELECT COUNT(*) AS count 
    FROM ' . TABLE_PREFIX . 'post
    WHERE dateline >= "' . strtotime("-1day") . '"
');
$newposts = number_format($newposts['count']);
 
5 comments
i had same code saved somewhere

PHP:
$newusers = $db->query_first('
SELECT COUNT(*) AS count
    FROM ' . TABLE_PREFIX . 'user
    WHERE joindate >= "' . strtotime("-1day") . '"
');
$newmembers = number_format($newusers['count']);
 
 
 
$newposts = $db->query_first('
SELECT COUNT(*) AS count
    FROM ' . TABLE_PREFIX . 'post
    WHERE dateline >= "' . strtotime("-1day") . '"
');
$newposts = number_format($newposts['count']);

cant see why it wouldnt work

did you update counters?
 
I get results

PHP:
New Users Registered Today: 41 
New Posts Posted Today:  1

New posts always stays at 1-3
and users registered moves around but the number is off
 
Status
Not open for further replies.
Back
Top