MySQL and datatime field and displaying on page
| From: | Charlie Grosvenor | Date: | Fri, 21 Jun 2002 13:42:59 +0000 |
| Subject: | MySQL and datatime field and displaying on page | ||
| Groups: | php.db php.db | ||
| Request: | Send a blank email to php-db+get-19955@lists.php.net to get a copy of this message | ||
Hi
I have a mysql table that has a field in it called 'DATETIMEADDED' which
has data type 'datetime' I want to display the contents of the field on my
page. I have tried usng the following code but the value in the
'DATETIMEADDED' only the value in the 'NAME' field which is a varchar is
displayed on the page. How can i get it to display the value in
'DATETIMEADDED'?
<ul>
<?
$query = "SELECT * FROM
BOARDITEMS WHERE BOARDID=$BOARDID ORDER
BY 'DATETIMEADDED';";
$resultboarditems = mysql_query ($query) or die("Invalid Result
Set");
while ($row = mysql_fetch_array ($resultboarditems)) {
?>
<li><? echo $row["DATETIMEADDED"]; ?><? echo
$row["NAME"]; ?></li>
<?
}
?>
</ul>
Thank you
Charlie