Jump to content


Photo

Displaying only one month and year per article?


  • Please log in to reply
1 reply to this topic

#1 cturner

cturner
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • LocationMy computer

Posted 20 October 2006 - 12:59 AM

Can someone please tell me how I can do what is in the subject? Thanks in advance.

Here is the code that I am working with:
require "config2.php";
// display each article title with the date
// get the current day
$currentday = date("j",mktime());

// get the current month
$currentmonth = date("F",mktime());

// get the current year
$currentyear = date("Y",mktime());

// select the current article
//$currentquery = mysql_query("SELECT * FROM `items` ORDER BY STR_TO_DATE(CONCAT(selectDay, selectMonth, selectYear), '%d%M%Y') DESC");
$currentquery = mysql_query("SELECT * FROM `items`");

while($row = mysql_fetch_array($currentquery)) {
	echo "<br /><br /><a href=article.php?articleid=".$row['articleid'].">".$row['selectMonth']." ".$row['selectYear']."</a>";
}
// display the current article
//while($row = mysql_fetch_array($currentquery)){
	//echo "<br /><br />".$row['selectDay']." ".$row['selectMonth']." ".$row['selectYear']."<br />";
	//echo "<a href=article.php?articleid=".$row['articleid'].">".$row['articletitle']."</a>";
//}

mysql_close();
[code][/code]


#2 cturner

cturner
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • LocationMy computer

Posted 21 October 2006 - 02:36 AM

Anyone please help urgent?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users