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

  • SEARCH
  • Home
  • 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 8359207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:04:21+00:00 2026-06-09T11:04:21+00:00

Let us say that this is my table in my database: ID | APP_TIME

  • 0

Let us say that this is my table in my database:

ID      | APP_TIME                  | NAME
----------------------------------------------------
1       | 2012-07-08 10:00:00       | John
2       | 2012-07-08 12:00:00       | Johnny
3       | 2012-07-09 13:00:00       | Fred
4       | 2012-07-10 09:00:00       | George
5       | 2012-07-10 10:30:00       | Eva
6       | 2012-07-10 14:00:00       | Monica
7       | 2012-07-11 12:00:00       | Helen
8       | 2012-07-11 13:00:00       | Kim

What I then want to output at my site:

07-08-2012
Time    | Name
----------------------------------------------------
10:00   | John
12:00   | Johnny


07-09-2012
Time    | Name
----------------------------------------------------
13:00   | Fred


07-10-2012
Time    | Name
----------------------------------------------------
09:00   | George
10:30   | Eva
14:00   | Monica


07-11-2012
Time    | Name
----------------------------------------------------
12:00   | Helen
13:00   | Kim

My problem is not formatting the datetime values and all that…
The challenge for me is to list the results accordingly to the dates they “belong” to.

Someone help ? 🙂

  • 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-09T11:04:23+00:00Added an answer on June 9, 2026 at 11:04 am

    Came up with this solution:

    $today = date('%Y-%m-%d 00:00:00');
    $get_dates = mysql_query("SELECT DISTINCT DATE_FORMAT(app_time, '%Y-%m-%d') AS new_date FROM reservations WHERE app_time > '$today' ORDER BY app_time ASC");
    while ($row = mysql_fetch_array($get_dates)) {
        $the_date = $row['new_date'];
        $results = mysql_query("SELECT * FROM reservations WHERE app_time >= '$the_date 00:00:00' AND app_time < '$the_date 23:59:59' ORDER BY app_time ASC");
        while ($the_results = mysql_fetch_array($results))
        {
        // Do some stuff eg:
        echo $the_results['name'] . '<br />';
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this table: id feed_id ... Let's say that I have 500 rows
Let's say I have a MySQL table that is something like this: software table:
Let's say that I've got this xml: <items> <item name=thumb> <downloadStream>test1</downloadStream> <downloadStream>test2</downloadStream> <downloadStream>test3</downloadStream> </item>
Let's say that I have something like this in my web.xml file. <filter name=foo>
Let's say, I have a normal normalized database like this: CREATE TABLE `users` (
Let's say I have two tables that look like this: TH TH TH TH
Let’s say that this is my string: 1 2 3 I want to split
Let's say that there is this command: g++ main.o somefile.o -lc -o main What
Let's say that I have this string: s = '<p>Hello!</p>' When I pass this
Let's say that I have a method that looks like this: def raise_if_client_status_error(xml_resp) #

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.