MySQL Forums
Forum List  »  Newbie

Re: MySQL Date
Posted by: David Long
Date: May 09, 2005 10:46AM

Well I did that but for some reason I cant wrap my head around it without a clear example, let me included my format:

<?

{
mysql_connect("localhost", "username", "password") or die ("Problem connecting to DataBase");
$query = "SELECT * from events ORDER BY date Desc";

$result = mysql_db_query("databasename", $query);

if ($result)
{

echo "<html><body bgcolor=#000000><table width=600 align=center border=0 cellpadding=2> <tr><td colspan=3><font color=#F6F036 face=arial><h4>Company V Show Dates:</h4></font><br></td></tr>";

while ($r = mysql_fetch_array($result)) { // Begin while
$date = $r["date"];
$title = $r["title"];
$club_name = $r["club_name"];
$address = $r["address"];
$city = $r["city"];
$state = $r["state"];
$zip = $r["zip"];
$telephone = $r["telephone"];
$website = $r["website"];
$comments = $r["comments"];


echo "<tr><td align=right width=295><font color=#F6F036 face=arial>Date:</font></td><td width=10>&nbsp;</td><td align=left valign=top width=295><font color=#ffffff face=arial>$date</font></td></tr>
<tr><td align=right><font color=#F6F036 face=arial>Club Name:</font></td><td>&nbsp;</td><td align=left valign=top><font color=#ffffff face=arial size=+1><strong>$club_name</strong></font></td></tr>
<tr><td align=right><font color=#F6F036 face=arial>Address:</font></td><td>&nbsp;</td><td align=left valign=top><font color=#ffffff face=arial>$address</font></td></tr>
<tr><td align=right><font color=#F6F036 face=arial>City, State, Zip:</font></td><td>&nbsp;</td><td align=left valign=top><font color=#ffffff face=arial>$city, $state&nbsp;&nbsp;$zip</font></td></tr>
<tr><td align=right><font color=#F6F036 face=arial>Telephone:</font></td><td>&nbsp;</td><td align=left valign=top><font color=#ffffff face=arial>$telephone</font></td></tr>
<tr><td align=right valign=top><a href=\"http://www.mapquest.com/maps/map.adp?searchtype=address&country=US&addtohistory=&searchtab=home&address=$address&city=$city&state=$state&zipcode=\" target=\"_blank\"><font color=#F6F036 face=arial>Click Here for Map</font></a></td><td>&nbsp;</td><td align=left valign=top><a href=\"http://$website\" target=\"_blank\"><font color=#F6F036 face=arial>$club_name</font></a></td></tr>
<tr><td colspan=3 align=center><font color=#F6F036 face=arial>$title&nbsp;&nbsp;$comments</font><br><br></td>
</tr>";

} // end while
echo "</table></body></html>";
} else { echo "problems...."; }
}

?>

Above where the echo statement lists the contents of the manually added date, I want it in the MM-DD-YYYY format.

I tried versions from the link you had given me but when it actually ran without error, it resulted in a blank field being produced.

Thanks for your help

Options: ReplyQuote


Subject
Written By
Posted
May 09, 2005 09:25AM
May 09, 2005 10:36AM
Re: MySQL Date
May 09, 2005 10:46AM
May 09, 2005 11:00AM
May 09, 2005 11:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.