I have a small CMS on my site where myself or my partner are able to update content from a simple admin section. I went to the site and noticed the last article that was suppose to appear in the Monthly Article section was blank? I figured out the problem...but not the fix.
The article has a "displaydate" which was set for September 1, 2003. When I change the "displaydate" to October 1, 2003 it appears on the site. The problem is...I want the article the last month's article to remain on the site if there is no new article for the current month.
The query currently reads as follows:
function get_this_month_article()
{
$thismonth = mktime(0,0,0,date('m'),1,date('Y'));
$sql = "select * from articles where displaydate = $thismonth limit 1";
$result = mysqlQueryDb($sql);
$qdata = mysql_fetch_object($result);
return $qdata;
}
What would I change to ensure that the Sept. article would continue to be displayed if an Oct. article is not submitted?
Thanks in advance.
The article has a "displaydate" which was set for September 1, 2003. When I change the "displaydate" to October 1, 2003 it appears on the site. The problem is...I want the article the last month's article to remain on the site if there is no new article for the current month.
The query currently reads as follows:
function get_this_month_article()
{
$thismonth = mktime(0,0,0,date('m'),1,date('Y'));
$sql = "select * from articles where displaydate = $thismonth limit 1";
$result = mysqlQueryDb($sql);
$qdata = mysql_fetch_object($result);
return $qdata;
}
What would I change to ensure that the Sept. article would continue to be displayed if an Oct. article is not submitted?
Thanks in advance.