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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.