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
https://forums.phpfreaks.com/topic/146376-php-mysql-blog/
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
https://forums.phpfreaks.com/topic/146376-php-mysql-blog/#findComment-768527
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
https://forums.phpfreaks.com/topic/146376-php-mysql-blog/#findComment-768537
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.