PDA

View Full Version : Trying to add a couple of queries to stats.php


ericgtr
12-13-2004, 03:31 PM
I would like my stats to show how many users have registered in the last 24 hours and can't get this query to work.

$newmembers = $DB_site->query_first("SELECT COUNT(*) AS count FROM ".TABLE_PREFIX."user WHERE joindate > ".(time()-3600*24).");

Here is the error I am getting:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/vhfansco/public_html/vb/modules/stats.php on line 32

What it's doing is giving me this parse error 2 lines past the line of code that I am adding for some reason but only when I add the above line of code. Any help would be appreciated :)

KW802
12-13-2004, 05:08 PM
I would like my stats to show how many users have registered in the last 24 hours and can't get this query to work. ...Try this instead:$newusers = $DB_site->query_first('
SELECT COUNT(*) AS count
FROM ' . TABLE_PREFIX . 'user
WHERE joindate >= "' . strtotime("-1day") . '"
');
$newmembers = number_format($newusers['count']);
:)

Our Sponsors
 

ericgtr
12-13-2004, 05:29 PM
Cool, I added it and changed it to $newusers in the adv_portal_stats template and it works! Thanks for the help :)

KW802
12-13-2004, 05:39 PM
Cool, I added it and changed it to $newusers in the adv_portal_stats template and it works! Thanks for the help :)No problem.