I have a following query
$query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC";
In the table, I call $list variable to get database results from the above variable. I then, have a foreach statement
foreach($list as $flight)
One of the columns echoes departure time value of a flight in a HH:MM format.
<td>'.$flight->deptime.'</td>
Essentially, I want to order the times in ascending order, going up, but I’m probably missing a step, because it doesn’t do it. It does it like this:
17:30
17:55
17:15
17:45
17:25
I performed a small check on the $query changing ASC to DESC, but the same thing happens, obviously with descending times.
deptimefromVARCHARtoTIME(proper way)ORDER BY deptimeorORDER BY deptime ASC