Jump to content

members in x days


brown2005

Recommended Posts

1 2008-03-12 17:22:43

2 2008-03-12 17:22:43

3 2008-02-11 17:22:43

 

i have the above 3 results in my table.. and it comes up with 1.. which is number 3... which is out of 30 days. the code above looks like it gives all members that have logged in before $x amount of days.. but i want from $x days to now....

 

any ideas would be much appreciated..

 

thanks in advance.

 

Link to comment
https://forums.phpfreaks.com/topic/95825-members-in-x-days/#findComment-490618
Share on other sites

This part:

members_login <= (NOW() - INTERVAL $x DAY)

 

means If the date members_login is less than or equal to x days ago.

 

 

I think I got the symbol messed up and turned the wrong way :P So change it to this:

SELECT COUNT(*) AS members_count FROM members WHERE members_login >= (NOW() - INTERVAL $x DAY)

 

Link to comment
https://forums.phpfreaks.com/topic/95825-members-in-x-days/#findComment-490801
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.