I'm trying to add two hours (7200 sec) for the timestamp on my blog, after retrieving it from the DB. I don't want to edit it before it's stored or change it in the DB.
Here's my code
Code: Select all
$query = 'SELECT * FROM blog_entries ORDER BY
date_entered DESC';
if ($r = mysql_query ($query)) { // Run the query.
// Retrieve and print every record.
while ($row = mysql_fetch_array ($r)) {
print"<p><h2>{$row['title']}</h2>
{$row['entry']}<br /><br />
<div id='advert'>This blog was
created on: {$row['date_entered']} CST";
$ztime = $row["date_entered"];
$ztime = $ztime+7200;
print"$ztime</div></p><hr />\n";The correct date/time shows up as it should from the {$row['date_entered']} call. The 9205 is from my calcution $ztime+7200. Which is partially right because 2005+7200=9205Testing
Is the date populated?
This blog was created on: 2005-06-29 13:12:46 CST9205
As you can tell I'm an absolute PHP/MySQL beginner so go easy on me please.