How could you query a MySQL database to determine if a user has logged in for 30 consecutive days or 100? Same will apply for other user actions too.
Assuming a DB table like below where a record is created each day for each user active on that day.
How could I query SELECT * WHERE user_id = 1 AND action = login
and find if there was 30 days or 100 days of logins where the days are in consecutive row with no day breaks in it?
User Stats Table
id
user_id
dateTime
action (login, made post, up voted, down votes, made comment, etc...)