Location: PHPKode > projects > News Manager - RSS aggregator > newsmanager/del_archive_news.php
<?php

$archive_lastday_ = strftime ("%Y-%m-%d", strtotime("-180 day"));
$sel_old_news="select * from rssurl_newsitem where pubdate <='$archive_lastday_'";
$sel_old_res=$pg_sql->query_pass($sel_old_news,"4");

for($ol=0;$ol<count($sel_old_res);$ol++)
{
   $del_old_news_cat="delete from newsitem_category where newsitem_id=".$sel_old_res[$ol]['url_newsitem_id'];
   $pg_sql->query_pass($del_old_news_cat,"4");

}

// Deleting Newsitem below Six Months from current date

 $del_old_news="delete from rssurl_newsitem where pubdate <='$archive_lastday_'";
 $pg_sql->query_pass($del_old_news,"4");


?>
Return current item: News Manager - RSS aggregator