The table name is Users
ID | name | created_at
------------------------------------------
1 | John | 2018-11-08 14:06:05
2 | Adam | 2018-12-12 10:06:05
3 | Peter | 2019-01-08 17:16:05
-------------------------------------------
How do I get how many new users i have received for each day of the last 30 days (using mysql or php or both). The results should look like this:
1-Sat 15
2-Sun 08
.
.
.
30-Fri 13
If the day has no records it shows 0.
I tried this but i get stuck:
select date_format(created_at,\'%a\') as day
from users
where datediff (now(),created_at) <=30
Thanks alot