I'm querying and posting to a mysql database where the date is in the date format. YYYY-MM-DD After querying the database, I would like to display the date as MM-DD-YYYY 07-11-2001. I would also like users to be able to enter dates as MM-DD-YYYY and have the dates be posted to the mysql database as YYYY-MM-DD.
<?
$connection = mysql_connect("localhost","root", "connect");
$sql = "SELECT * FROM inventory";
$sql_result = mysql_query($sql, $connection);
$row = mysql_fetch_array ($sql_result)
$body=$row["body"];
$date_entered=$row["date_entered"];
?>
<p>Date Entered:
<?
/ Print results of the querry /
echo "$date_entered";
?>
I've read some of the php date examples but am confused as how to apply them in my case. Any suggestions? Thanks.