Reply to Re: Date is not being pulled from MYSQL database, instead current date is displayed!!!

Your name:

Reply:


Posted by ameshkin on 03/24/06 00:54

Here is a reply in another forum after someone stated taht it was
strange taht still did not work.

The page is at http://www.mytuneslive.com/ameshkin69/

OK, what I did is just output the raw $row_comment['timestamp']

This gives u the value in the database in a unix timestamp. Below is
the mysql query....and underneath that is the entire table in case
something else is causing trouble.


mysql_select_db($database_premium, $premium);
$query_comment = "SELECT comments.owner, comments.`timestamp` ,
comments.comment,


comments.author, comments.cmtpic, comments.auto
FROM comments
WHERE comments.owner = '$me'
ORDER BY `comments`.`auto` DESC";
$comment = mysql_query($query_comment, $premium) or die(mysql_error());

$row_comment = mysql_fetch_assoc($comment);
$totalRows_comment = mysql_num_rows($comment);


SQL ABOVE


TABLE BELOW


<td height="240" colspan="3" align="left" valign="top"
class="none"><br>
<h1 align="center">COMMENTS</h1>
<?php do { ?>
<table width="100%" border="0">
<tr>
<td width="45%" align="center" valign="top"><a


href="http://www.mytuneslive.com/<?php echo $row_comment['author'];
?>/"><?php echo


$row_comment['author']; ?></a><br>
<?php $condition = $row_comment['cmtpic'];
$a = $row_comment['author'];


if ( $condition > '1' ) {


echo "<center><a href=\"http://www.mytuneslive.com/$a/\"><img
src=\"$condition\"


border=\"0\"/>";



} else {


echo "<br>";

}


?>

</td>
<td width="55%" align="left" valign="top"><?php
$day = gmdate("n-d-Y g:i A",$row_comment['timestamp'] );
//$day = $row_comment['timestamp'];
echo gmdate("n-d-Y g:i A",$day);
echo "<br><br>";
echo $row_comment['timestamp'];
?> <br><br>
<?php echo $row_comment['comment']; ?> </td>

</tr>
</table>
<?php } while ($row_comment = mysql_fetch_assoc($comment));
?></td>
</tr>
<tr>

[Back to original 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

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