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 8290721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:53:36+00:00 2026-06-08T12:53:36+00:00

first of all i have a table like this: userID Day Hour Class —————————————

  • 0

first of all i have a table like this:

userID   Day      Hour   Class
---------------------------------------
65       Monday   08:00  Math 
65       Monday   09:00  Bio
65       Monday   13:00  History
65       Tuesday  08:00  Sports
65       Friday   10:00  Math

I am choosing the classes according to the current time.
When it is 08:30 then i need to choose the next Hour which is 09:00 and it is Bio. And it is fine.
But when it is 10:00 then i need to choose 13:00 which is History.

Added: lets say today is Tuesday and it is 07:00 o’clock. With the code below , I can choose tne next coming Class whish is at 08:00 on Tuesday.
Lets assume today is Tuesday and 12:00 o’clock. How can I choose the next lecture which is on Friday (next weekday that I have a class on).

When I have no class in one day ,how can I choose the next avaible day that I have a class …?

  • 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-08T12:53:38+00:00Added an answer on June 8, 2026 at 12:53 pm

    try something like this:

    select `Hour`, Class
    from your_table
    where time(`Hour`) > curtime()
    and `Day` = DAYNAME(now())
    order by time(`Hour`) asc
    limit 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all I have many Django instances setup and running like this. In
I have two tables. First table looks like this: Table: Records rid | user
I have a table (Counts) with many entries like this: ID | userid |
First of all I have searched many times in this forum but none is
First of all i have to clear few things 1.This is not spam group
For example, I have a table which looks like this : id | name
all! I have the following problem: I have 2 simple tables. The first one,
First of all I have to say I am new to iOS development. My
First of all i have frames on my SD Card and frames are there
So first of all I have such image (and ofcourse I have all points

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.