Forum Moderators: coopster
What I am trying to achieve is that if you get a month number, I would like to convert into month name i.e. March.
Now I've had a go, but it doesn't quite work because its not looping correctly, what I mean, it displays 'March'. Any ideas anyone?
Thanks
W.
<?
$result=mysql_query("SELECT distinct MONTH(story_date) as month,YEAR(story_date) as year
FROM tbl_news WHERE tbl_news.ncid=$ncid
order by month asc");
while (list($DBmonth,$DByear)=mysql_fetch_row($result))
{
echo $DBmonth.'<br><br>';
$unixdate=strtotime ($DBmonth);
$date_time_array=getdate($unixdate);
$month_c=$date_time_array["month"];
$month_title=$month_c;
echo $month_title.'<br>';
}
?>
<?
$result=mysql_query("SELECT distinct MONTH(story_date) as month,YEAR(story_date) as year
FROM tbl_news WHERE tbl_news.ncid=$ncid
order by month asc");
while (list($DBmonth,$DByear)=mysql_fetch_row($result))
{
$date = date('F', mktime(0, 0, 0, $DBmonth));
echo $date .'<br>';
}
?>
Thanks
W. :o)