1 (edited by cuteseal 2004-08-17 07:41)

Topic: Last 24 hours

Hi,

Just looking for a db query that will show the number of new topics and posts within the last 24/48 hours...

Can anyone help?  These counts and group bys are confusing me big_smile

I'm looking to add it to the stats at the bottom of my forums index page.

TIA
Jules

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

Re: Last 24 hours

This query selects how many users who have been logged in within 24 hours. The same principle should works fine for your purpose.

SELECT count(*) FROM '.$db->prefix.'users WHERE id>1 AND FROM_UNIXTIME(last_action) > DATE_SUB(NOW(), INTERVAL 1 DAY)