You are here: Re: Timestamp problem « PHP Programming Language « IT news, forums, messages
Re: Timestamp problem

Posted by damezumari on 11/24/19 11:28

Thanks! It worked!

Here is the follow-up problem:

I now have 20051004093359, say, in the lastupdated field which is
timestamp(14).

However,

<?php
require 'citc_connect.php';
$csql = 'select
imagepath,
text,
lastupdated
from citc_weather';
$result = mysql_query($csql);
$nrows = mysql_affected_rows();
if ($nrows == -1) {echo 'Unexpected error in the query:<br/>';
die($csql);};
$row = mysql_fetch_array($result);
?>

<html>
<body>
<p>Last updated: <?php echo $row['lastupdated']; ?> </p>
<p>Last updated: <?php echo date('l j-M h:i A', $row['lastupdated']);
?> </p>
</body>
</html>

Gives:

Last updated: 20051004093359
Last updated: Tuesday 19-Jan 11:14 AM

The last line should read:

Last updated: Tuesday 4-Oct 9:33 AM

What am I doing wrong?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация