Need help displaying formatted date
| From: | Jason Zimberoff | Date: | Thu, 24 Aug 2000 04:15:37 +0000 |
| Subject: | Need help displaying formatted date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-13295@lists.php.net to get a copy of this message | ||
Howdy.
Im new to PHP and mysql this week, so please understand if this is a dumb
question...
I am trying to use a column of dates in my database to display on my
web page in a format different from YYY-MM-DD.
I see that there is a date_format() function, but can't seem to make it
work.
Right now the code just displays the date in the standard format. I want
it to look like "March, 2000".
Any suggestions?
Thanks in advance!
Here is some of the code:
-----------
<?php
include ("rem.inc");
$dbh = rem_connect() or die("cannot connect to server");
$seven_s = "select title, date, type, id, label, country, catalog, notes from discog
where type like '%7s%'";
$result = @mysql_select_db("rem", $dbh);
$result = @mysql_query($seven_s, $dbh);
while ($row = @mysql_fetch_array($result)) {
print "<font color=yellow><p><h3>" . $row['title'] .
"</h3>
<font color=white>";
print "<table cellpadding=2 border=0>
<tr><td><b>Label:</b></td><td>" .
$row['label'] . "</td>
</tr>";
print "<tr><td><b>Catalog:</b></td><td>" .
$row['catalog'] . "</td>
</tr>";
print "<tr><td><b>Country:</b></td><td>" .
$row['country'] . "</td>
</tr>";
print "<tr><td><b>Format:</b></td><td>7"
Vinyl Single</td>
</tr>";
print "<tr><td><b>Date:</b></td><td>" .
$row['date'] . "</td>
</tr></table><p>";
print $row['notes'] . "<p>";
print $row['id'] . "<p>";
print "<hr>";
}
?>
</body>
</html>
--------------------------------------------------------------------------------
R.E.M. Collector's Guide - www.svs.com/rem - Jason Zimberoff - zim@svs.com
--------------------------------------------------------------------------------