Here is my query:
SELECT temp_table.*
FROM
( SELECT COUNT(*) as hits_count
, date
FROM visits
GROUP
BY date
) as temp_table
ORDER
BY temp_table.date ASC
LIMIT 15
I insert a new record into this table each time an user access a page. I need to get those records stacked by their date. It worked untill it hit the limit of 15 days, so now it doesn't show other days, it stops on his limit(15).
To make it clearer, let say I have stored 20 days, it shows just the 1-15 day interval, but i need it to get from db the interval 5-20, and so on.