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?

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.