When I pull the data out of my database. The date shows exactly like it is in the database. How can I get it to format in the standard DD/MM/YYYY.
This is what my output looks like.
Start Date End Date Event Name
2002-11-28 2002-11-29 Happy Thanksgiving.
This is my code.
//connect to database and open it
$db = mysql_connect("localhost", "root"
mysql_select_db("cadb",$db);
$tableName = "calendarElem";
$pageName = "elem_calendar.php";
mysql_query("DELETE from calendarElem where endDate <= curdate()"
$result = mysql_query("SELECT * FROM calendarElem ORDER BY startDate",$db);
echo "<table border=0 cellpadding=5 cellspacing=0><tr><td><b>Start Date</b></td><td><b>End Date</b></td><td><b>Event Name</b></td></tr>";
if ($myrow = mysql_fetch_array($result)) {
do {
printf("<tr><td><b>%s</b></td><td><b>%s</b></td><td>%s</td></tr>", $myrow["startDate"], $myrow["endDate"], $myrow["description"] );
} while ($myrow = mysql_fetch_array($result));
}
echo "</table>"; When faced with a decision, always ask, 'Which would be the most fun?'
This is what my output looks like.
Start Date End Date Event Name
2002-11-28 2002-11-29 Happy Thanksgiving.
This is my code.
//connect to database and open it
$db = mysql_connect("localhost", "root"
mysql_select_db("cadb",$db);
$tableName = "calendarElem";
$pageName = "elem_calendar.php";
mysql_query("DELETE from calendarElem where endDate <= curdate()"
$result = mysql_query("SELECT * FROM calendarElem ORDER BY startDate",$db);
echo "<table border=0 cellpadding=5 cellspacing=0><tr><td><b>Start Date</b></td><td><b>End Date</b></td><td><b>Event Name</b></td></tr>";
if ($myrow = mysql_fetch_array($result)) {
do {
printf("<tr><td><b>%s</b></td><td><b>%s</b></td><td>%s</td></tr>", $myrow["startDate"], $myrow["endDate"], $myrow["description"] );
} while ($myrow = mysql_fetch_array($result));
}
echo "</table>"; When faced with a decision, always ask, 'Which would be the most fun?'