I have a database full of football fixtures, sorted in descending order. Everything works fine however the dates are in the following format: YYYYMMDD like so - 2014-05-11.
All table contents are selected with:
$result = mysqli_query($con,"SELECT * FROM Fixtures ORDER BY Date DESC");
Then inserted into the table with the below code:
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Date'] . "</td>";
echo "<td>" . $row['Home Team'] . "</td>";
echo "<td>" . $row['Score'] . "</td>";
echo "<td>" . $row['Away Team'] . "</td>";
echo "<td>" . $row['Score1'] . "</td>";
echo "<td>" . $row['Competition'] . "</td>";
echo "</tr>";
}
echo "</table>";
How can I make it so these dates appear DDMMYYYY such as 11-05-2014?
Thanks!