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

Recommended Answers

All 3 Replies

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.

Member Avatar for diafol

You can try this sort of syntax:

GROUP BY YEAR(blog_date), MONTH(blog_date)

Hi ardav,

Thanks for the example. Looks very simple now lol.

Thank you! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.