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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:21:59+00:00 2026-05-16T22:21:59+00:00

I have a mysql table with users and their weekly calendar. Every user can

  • 0

I have a mysql table with users and their weekly calendar.

Every user can set his own availability for the week (morning, afternoon, night / MON thru SAT), and that is not going to change often, almost never.

Imagine those users are personal trainers in a gym, or tennis courts you can book…

My problem here is to find the right query (or maybe even rethinking the way i’m storing that data in mysql) in order for an external web user to check availability of them based on 3 check buttons [o]morning, [o]afternoon, and [o]night

So I want my web user to go to my website and check/uncheck those buttons in order to see which one (personal trainer, or whatever) is available

So if I check Morning i can see only the people available, also (but not only), in the morning,(because a personal trainer can be available during the morning but also in the afternoon etc..)..

it may sounds an easy problem but i’m having hard time…

any help is appreciated

Thanks!

  • 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-05-16T22:21:59+00:00Added an answer on May 16, 2026 at 10:21 pm

    This isn’t really an algorithm question, this is more of a DBA question. You’d most likely have a user table and an availability table.

    user:
        userid
        ...
    
    availability:
        userid
        day
        timeofday
    

    When given a query such as Monday Wednesday Morning Afternoon (assuming the relationship is (Monday OR Wednesday) AND (Morning OR Afternoon)) you can do a query such as.

    SELECT userid FROM availability WHERE day='wednesday' OR day is 'monday' AND timeofday='morning' OR timeofday='afternoon'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MYSQL-Table which stores scores. Every time a user improves a new
I have a MySQL table called Users. The rows have 4 fields and look
Lets say I have a MySQL table, Users, like this - ----------------------------------------- ID |
So I have a mySQL database with a 'users' table which includes a username,
using php and mysql I have two tables, a users table and a profiles
I have a table which looks like this: mysql> SHOW COLUMNS FROM Users; +------------+--------------+------+-----+---------+----------------+
Using MySQL, I have a simple table that logs the IP Address that users
I am using mysql and have a table (Log_Table) storing user login dates, a
I have a table generated by PHP/mysql, I want a user to click the
I have a MySQL table of users whose primary key is an auto-incrementing integer

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.