Re: Timestamp problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Timestamp problem

From: damezumari <jannordgreen@gmail.com>
Date: Tue Oct 04 2005 - 16:51:59 CEST

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?
Received on Tue Oct 18 02:31:38 2005