select a.Date
from (
select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as Date
from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c
) a
where a.Date between '2015-04-15' and '2015-05-15' ORDER BY Date
Above query working fine I am getting 30 records from selected date to selected date. But I want to show complete month record. If i choose February
then all 28 days(29 if leap year) record will showing. Same as Mar
= 31
records April
= 30
records. etc.
EDIT : See screenshot. I want to show all days in a month.
If possible to PHP please post your answer.