Skip to content
WJunction - Webmaster Forum

VB Coding Help

Status
Not open for further replies.
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.

About the author

D
Active Member · Joined
Gaming
3,591
Messages
9
Reactions
38
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom