Need the PHP query to display the date as MM-DD-YYYY instead of YYYY-MM-DD -
this question has answer here:
- convert 1 date format in php 12 answers
i need php query display date mm-dd-yyyy instead of yyyy-mm-dd. here code retrieve date, don’t know how convert date format.
$sql = 'select * tmp order 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();
?>
you can in mysql in following way:
select date_format(photodate, '%m-%d-%y') tmp order photodate asc
Comments
Post a Comment