Related:
This is a continuation from my earlier question, Wrong Logic in If Statement?
$repeat_times = mysql_real_escape_string($repeat_times);
$result = mysql_query("SELECT `code`,`datetime` FROM `fc` ORDER by datetime desc LIMIT 25") or die(mysql_error());
$output .="";
$seconds = time() - strtotime($fetch_array["datetime"]);
if($seconds < 60)
$interval = "$seconds seconds";
else
if($seconds < 3600)
$interval = floor($seconds / 60) . " minutes";
else
if($seconds < 86400)
$interval = floor($seconds / 3600) . " hours";
else
$interval = floor($seconds / 86400) . " days";
while ($fetch_array = mysql_fetch_array($result)) {
$fetch_array["code"] = htmlentities($fetch_array["code"]);
$output .= "<li><a href=\"http://www.***.com/?code=" . htmlspecialchars(urlencode($fetch_array["code"])) . "\" target=\"_blank\">" . htmlspecialchars($fetch_array["code"]) . "</a> (" . $fetch_array["datetime"] . ") </li>";
}
$output .="";
return $output;
Okay, fixed last problem. Now it's just outputtign the [DateTime] function when I want it to output :
LINK (5 Seconds Ago)
LINK (1 Minute Ago)
etc.
It's doing: janice (2009-08-05 14:02:01)
Please advise?