I have a guestbook script and wish to add month and year to the first post of each month like Instagram profiles demo
so my question is how can I grab month and year from db timestamp and add to first record per month?
db structure:
post
--id
--msg
--dt (timestamp)
I know (and am sorry) this is a bit of a "can you do the work for me" post but I haven't got a clue where I would start.
tried so far:
SELECT DISTINCT MONTH(dt), YEAR(dt) AS month FROM post GROUP BY MONTH(dt)
...
SELECT DISTINCT dt FROM post ORDER BY dt DESC