indiodoido Posted February 22, 2009 Share Posted February 22, 2009 hi, I'm thinking on developing a simple blog in PHP & MySQL. The only thing i want in the blog is the possibility to enter posts and archive them by date (month and year). I have everything planed out, but i really don't know how to organize my posts in the blog by date For example: Archives: Dec 08 - Jan 09 - Feb 09 Can anyone tell me how to do this, or give me an example code? Quote Link to comment Share on other sites More sharing options...
dmccabe Posted February 22, 2009 Share Posted February 22, 2009 Basically what you are needing to do is to record the date when posting your blog to your database. The for your archive simply create the sql queries to order them by date and output the results. YOu can split them in to day year month etc by performing calculations on the date they were entered and the date now. http://uk3.php.net/date Quote Link to comment Share on other sites More sharing options...
indiodoido Posted February 22, 2009 Author Share Posted February 22, 2009 hi dmccabe I do have a date and time field in my post table. But what i really would like to do is, not to order them by date, that i can do. I what to create a archive menu, so that older posts can be grouped by date. In stead of paging all my posts, i want to group them in months. Example: Post N : ... Feb 09 Post 9 : 22 Feb 09 (...) Post 1 : 01 Feb 09 Archives: Nov 08 - Dec 08 - Jan 09 <- i want to create this Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.