Hello everyone,
I'm extracting a query from my mySQL database for a news article on my site, but when I extract it, the date is set to "Wednesday, December 31st, 1969" instead of the date extracted from the mySQL (the format is correct, however). Here is my php code:
<?php
include "global_header.php";
include "db_open.php";
$id = $_GET['id'];
$query = "SELECT * FROM `news_articles` WHERE `id` = '$id' ";
$result = mysql_query($query);
while ($array = mysql_fetch_array($result)) {
$title = $array['news_title'];
$blurb = $array['news_short'];
$image = $array['news_image'];
$story = $array['news_full'];
$date = $array['news_date'];
$authid = $array['news_auth'];
$query = "SELECT * FROM `forums_members` WHERE `ID_MEMBER` = '$authid' ";
$authrslt = mysql_query($query);
while ($autharray = mysql_fetch_array($authrslt)) {
$author = $autharray['memberName'];
}
?>
<table width="575" border="0" cellspacing="0" cellpadding="1">
<tr>
<td><span class="largetext style4"><strong>
<?php
echo $title;
?>
<br /></strong><span class="nav"><em>Posted on
<?php
$dateext = date("l, F jS, Y",$date);
echo $dateext . " ";
?>
by
<?php
echo $author;
?>
</em></span></span></td>
</tr>
<tr>
<td height="1" bgcolor="#000000"></td>
</tr>
<tr>
<td><span class="style1"><img src="images/news/
<?php
echo $image;
?>
.gif" width="150" height="150" hspace="10" vspace="10" border="0" align="right" />
<?php
echo $story;
?>
</span></td>
</tr>
</table>
<?php
}
include "global_footer.php";
?>
Any help would be greatly appreciated.
Thanks,
-Reality15