Below is my coding for my blog.php. Upon retrieval of the data, my date does not appear right. it's always dated 31 dec 7:33PM Anyone can advise a newbie here? :bemused:
Thanks in advance for any help/advise given 🙂
$query = "SELECT title , entry , date_entered , id FROM blog_entries ORDER
BY date_entered DESC";
If ($r = mysql_query ($query)) {
//sending the query to the mySQL server
While ($row = mysql_fetch_array($r)) {
//inputs the data into the table
//The while loop will go through the entire array
$date_entered = date (' F j g:i A' , $row['date_entered']);
$user = $row['id'];
$title = $row['title'];
$entry = nl2br ($entry);
?>
<table align="center" border="0" width="80%">
<tr>
<td>
<b><?php echo $title; ?></b>-
Posted by: <b><?php echo $user; ?></b>
</td>
<td>
<div align="right"><?php echo $date_entered; ?></div>
</td>
</tr>
<tr>
<td colspan="2">
<?php echo $entry; ?>
</td>
</tr>
</table><br />
<?php }
} else { //query did not run.
die (mysql_error());
}
mysql_close();
?>