How to archive data by month?
Hi Guys,
I have a problem regarding of archiving. How we are going to archives data by month? I have 4 fields(id, dates, title,description). I want to archives my data by month in which you can see the Month automatically from database MySQL. Example Dates automatically display from database News for November News for October News for September when you click each of this month it will directly open a page archives for each month. Can anyone help me please. I really confuse how to do it. Thanks for advance guys.
2 Answers
Is this correct?
SELECT date_format(dates, '%Y-%M') as monthly_display FROM your_table GROUP BY date_format(dates, '%Y-%M'); And is the output of this SELECT * FROM table_name WHERE MONTH(date_column) = 4 ? Posted: roly 0 of 0 people found this answer helpful. Did you? Yes No
use date_format
SELECT date_format(your_column, '%Y-%M') as monthly_display FROM your_table GROUP BY date_format(your_column, '%Y-%M');or you can do by this SELECT * FROM table_name WHERE MONTH(date_column) = 4for april month Posted: MacOS 1 of 1 people found this answer helpful. Did you? Yes No |
© Advanced Web Core. All rights reserved