Jump to content

[SOLVED] Variables constantly echo todays date . . . ?


Styles2304

Recommended Posts

I'm trying to have the news section spit out the date of the event that it is displaying in a prettier format. For example, displaying "2007-09-27" as "September 27" . . .however, it won't spit out anything but todays date.

 

Here is what I have at the moment:

<?php
include "conn.inc.php";

$query = "SELECT Title, Body FROM CalendarEvents WHERE ((EventDate >= CURRENT_DATE) AND (Validate = 1)) ORDER BY EventDate LIMIT 1";

$result = mysql_query($query,$link)
            or die(mysql_error());
            
while ($row = mysql_fetch_array($result)) {
  $Title = $row['Title'];
  $Body = $row['Body'];
  $EventDate = $row['EventDate'];
  $currentTimeStamp = strtotime("$EventDate");
  $EventMonth = date("F", $currentTimeStamp);
  $EventDay = date("j", $currentTimeStamp);
}

?>

<html>
<head>
<title>New Covenant Fellowship</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">

<script src="linkframe.js">
</script>

</head>
<body bgcolor="ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<center>
<table width="100%" cellpadding="0" cellspacing="2" border="0">
	<td width="*" valign="top">

	<center>

		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td valign="top" bgcolor="2b496d" align="center">
					<font face="verdana" color="FFFFFF">
              <?php echo $EventMonth . ' ' . $EventDay . ' - ' . $Title; ?>
					</font>
				</td>
			</tr>
			<tr>
				<td valign="top" height="130" align="center">
					<?php echo $Body; ?>
				</td>
			</tr>
		</table>


	</td>

	</center>
</table>
</center>

 

I've also tried doing things similar to $EventDay = date("j", $EventDate); . . . that yields the same output.

 

Can anyone give me a hand?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.