(Working on a guestbook type page.) All entries are displayed properly with their unique names/emails/comments, however the date marked on each entry outputted has the same exact date... the date of the latest entry. I've checked the database and the entries definitely have differing dates.
Code:
$get_query = "select Name, Email, Comment, Date from entries ORDER by Id DESC;";
$get_rs = mysql_query($get_query);
// While there are still results
while($get_row = mysql_fetch_array($get_rs)) {
$name = stripslashes($get_row["Name"]);
$email = stripslashes($get_row["Email"]);
$comment = stripslashes($get_row["Comment"]);
$date2 = date('D, M j, Y', strtotime($get_row['date']));
$tableOpen ="<table align=\"center\"><th>$name</th><tr><td>";
$tableClose = "</td></tr></table>";
$gb_str2 .= $tableOpen;
if(!empty($name)) {
// If name exists and email exists, link name to email
if(!empty($email)) {
$name="by <a href=\"mailto:$email\">$name</a>";
}
else {
$name="";
}
// Else make name blank
} else {
$name = "";
}
// Append to string we'll print later on
$gb_str2 .= "<br/>$comment<hr><font size=1>posted on $date2 $name".$tableClose."</font><br>";
}
echo $gb_str2;
For instance, every single post is recorded with "posted on Mon, Jul 11, 2011" today, although there were many posts entered on other dates.