Hi
I have got a collection of news articles held in a database that I wish to archive.
What I want to do is to display groups of articles as to the month and year that they were published,
e.g. Jan 2004 Articles, Feb 2004 Articles etc
I want this to be on going for the future so it can maintain itself,
I was wonderingif anyone knew how to do this or any scripts available?
Thanks
archiving news items
Moderator: General Moderators
well.. there must exists scripts like that on http://www.hotscripts.com/PHP/Scripts_a ... index.html (hotscripts) but the bad thing about that is that those functions will most likely be hard coded in the script and not easy o get them out...
and besides that.. i`m also looking for a easy way to do this
and besides that.. i`m also looking for a easy way to do this
Code: Select all
CREATE TABLE `rss` (
`rss_id` int(50) NOT NULL auto_increment,
`headline` varchar(255) NOT NULL default '',
`content` text NOT NULL,
`news_url` varchar(255) NOT NULL default '',
`pub_date` date NOT NULL default '0000-00-00',
`image` varchar(255) NOT NULL default '',
PRIMARY KEY (`rss_id`)
) TYPE=MyISAM AUTO_INCREMENT=21 ;thanks
Well .. to get all the articles published in (for example) Feb 2005 ..
That's all you need to know..
Code: Select all
select * from rss where MONTH(pub_date) = 2 and YEAR(pub_date) = 2005make use of the date (and it's children) syntax in your select statements.
http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html
http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html