I need the PHP query to display the date as MM-DD-YYYY instead of YYYY-MM-DD. Here is my code to retrieve the date, just don’t know how to convert the date format.
$sql = 'SELECT * FROM tmp ORDER BY photodate ASC';
//display results
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr class=table-row><td align=center>".$row["photodate"]."<br><center>"."</center><br></td></tr>";
}
echo "</table>";
}
else{
echo "0 results";
}
arsort($band);
$conn->close();
?>