Jump to content

PHP & MySQL BLog


indiodoido

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.