[RESOLVED] Select Order by starttime
When i use the following code
The result I get is the 12:00 pm displays before 9:00 am. I assume because 1 comes before 9. But I would like the Displays to show cronologically from morning to night.
$sql="SELECT * FROM forms ORDER BY starttime";
Sounds like starttime is some sort of character/text field, not a time, timestamp, or datetime field. The best solution would be to convert that column to an appropriate type. If that's not possible for some reason, then you would need to cast each one to one of those types within the query (which is pretty inefficient).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)