954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Logic of Building a Blog Archive ?

Hello,

I am going to be building a blog and have rattled my brains out on this but could someone please explain in much detail as possible how i would go about building a blog archive ?

I don't mean i want the php code just the logic behind it.

I not started on anything yet as want to get the logic rite, everything else i seem to be ok with but i cannot for the life of me think how i would build an archive for the blog.

Blog posts will be stored by month/year and just cannot think how i would go about it.

I have searched high and low on Google but all i end up getting is how to build an archive word press plugin etc (something along those lines)

Thanks for any help/advice!

phplover

phplover
Junior Poster in Training
97 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

If every blog entry has a creation date in datetime format, you can build your archive on that with a simple query. From that mysql can easily extract the month and year, and sort on it.

pritaeas
Posting Expert
Moderator
5,483 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

You can try this sort of syntax:

GROUP BY YEAR(blog_date), MONTH(blog_date)

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

Hi ardav,

Thanks for the example. Looks very simple now lol.

Thank you! :)

phplover
Junior Poster in Training
97 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: