Quick tip of the day, wounder you like to take a count of all active/online users from your databse for certain period of time. Following would be the query.
SELECT count(*) FROM users
WHERE active = 1 AND last_signin >= date_sub(now(), INTERVAL 90 DAY)
ORDER BY last_signin DESC;
In my case, I have two columns those I can target when make count of online active users.
- active
- last_signin
The query above will provide you count of active online users for last 90 days.