AdRock Posted January 20, 2007 Share Posted January 20, 2007 I have a content management system and some articles can get out-dated.I don't want to delete the articles but would like to archive them somehow so I can create a link to view archived articles.I am looking for suggestions on how i would do this. Would I need to update the database by creating an extra field which decides if it is current or archive and displays only the current articles.Any suggestions would be great Quote Link to comment https://forums.phpfreaks.com/topic/34985-suggestions-on-how-to-archive-old-articles/ Share on other sites More sharing options...
utexas_pjm Posted January 20, 2007 Share Posted January 20, 2007 Update the SQL query to make it time sensitive.Consider the following:[code]SELECT * FROM `your_table` WHERE DATE(`publish_date`) > DATE_ADD(NOW(), INTERVAL -30 DAY)[/code]This will give you all articles published in the last month. You can you use the inverse to get articles published in the last 30 days.Best,Patrick Quote Link to comment https://forums.phpfreaks.com/topic/34985-suggestions-on-how-to-archive-old-articles/#findComment-164993 Share on other sites More sharing options...
tryingtolearn Posted January 20, 2007 Share Posted January 20, 2007 Right now I have a date submitted field so I used [code]SELECT * FROM `your_table` ORDER BY date_submitted DESC LIMIT 0,3[/code]This gives me the three latest articles.But I am learning so this may not be the best approach. Quote Link to comment https://forums.phpfreaks.com/topic/34985-suggestions-on-how-to-archive-old-articles/#findComment-164995 Share on other sites More sharing options...
bouga Posted October 25, 2007 Share Posted October 25, 2007 I have 2 solutions wich achieve the same objective. And please I am not an expert or anything 1. Yes u might have to alter ur DB and create a table that will contain all ur achieved articales and right a small program that will check the DB for old articles on regular intervals and send those which are old to the new table 2. The same as the first one difference is this time u don't alter your DB instead create a folder that will House all the old articles and create a field in one of ur tables that will link to those articles Quote Link to comment https://forums.phpfreaks.com/topic/34985-suggestions-on-how-to-archive-old-articles/#findComment-377720 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.