Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9208477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:37:35+00:00 2026-06-18T00:37:35+00:00

I have a following query $query = SELECT * FROM phpvms_schedules ORDER BY deptime

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:37:36+00:00Added an answer on June 18, 2026 at 12:37 am
    1. Change deptime from VARCHAR to TIME (proper way)
    2. Query like ORDER BY deptime or ORDER BY deptime ASC
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query SELECT Id, Request, BookingDate, BookingId FROM Table ORDER BY
i have the following query: select * from table where table.DateUpdated >='2010-05-03 08:31:13:000' all
I have the following query SELECT * FROM table WHERE id IN (5,4,3,1,6) and
I have the following query: SELECT * FROM shop_user_member_spots WHERE delete_flag = 0 ORDER
I have the following SQL query: SELECT * FROM table WHERE field_1 <> field_2
I have the following query: SELECT * FROM table WHERE tags LIKE '%$search%' AND
I have the following Oracle query SELECT * FROM table WHERE date_opened BETWEEN ((TO_DATE('2011-08-01',
I have the following query: SELECT rowid FROM table1 ORDER BY RANDOM() LIMIT 1
Lets say I have following query: SELECT * FROM table WHERE id = 1
i have following Query select * from DATABASE.dbo.Rooms r where not exists (select *

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.