Jump to content

how can i categorize articles into published month and year


aftab_jii

Recommended Posts

im working on a blog/online diary and want to sort published articles according to months and year just like on blog pages and i need help with the table and code..

my sql-table for the articles look like:

 

CREATE TABLE `articles` (

  `article_id` int(11) NOT NULL auto_increment,

  `category` varchar(100) NOT NULL default '',

  `author_id` int(11) NOT NULL default '0',

  `is_published` tinyint(1) NOT NULL default '0',

  `date_submitted` datetime NOT NULL default '0000-00-00 00:00:00',

  `date_published` datetime NOT NULL default '0000-00-00 00:00:00',

  `title` varchar(255) NOT NULL default '',

  `body` mediumtext NOT NULL,

  PRIMARY KEY  (`article_id`),

  KEY `IdxArticle` (`author_id`,`date_submitted`),

  FULLTEXT KEY `IdxText` (`title`,`body`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=165 ;

 

do i need to create a new table , do changes in the current table or do i have to write new code in PHP for the article.php ?

 

are there any code examples on the net you peope can refer me to?

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.