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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:02:07+00:00 2026-06-18T22:02:07+00:00

I have this combo box, to select a day a given flight in this

  • 0

I have this combo box, to select a day a given flight in this case operates on.

            <select style="border:1px solid #DCDCDC; color:#003663; font-size:11px;" class="search" name="day" id="day">
                <option value="0">Sunday</option>
                <option value="1">Monday</option>
                <option value="2">Tuesday</option>
                <option value="3">Wednesday</option>
                <option value="4">Thursday</option>
                <option value="5">Friday</option>
                <option value="6">Saturday</option>
            </select>

The table we’ll be looking for information is called db_schedules. The table structure contains a column called daysofweek. 0123456 specify days, 0 being a Sunday, 1-6 Monday-Saturday. Each record has a specified daysofweek value i.e schedule 3 is enabled in searches on days 346.

Based on the above, how do I query the database for a search based upon the selected option from the combo box?

  • 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-18T22:02:09+00:00Added an answer on June 18, 2026 at 10:02 pm

    It’s not clear, from the question, the datatype of column daysofweek, whether that’s a varchar and you’re storing a string that indicates a set of days, (e.g a value of ‘1235’ representings Mon, Tue, Wed and Fri), or whether that’s an integer column, and you have multiple rows, one for each day.

    If it’s a VARCHAR column, to search for days 3, 4 and 6, if you want any db_schedule row that matches any of those days:

    SELECT ... 
     FROM db_schedule d
    WHERE (  d.daysofweek LIKE '%3%' 
          OR d.daysofweek LIKE '%4%'  
          OR d.daysofweek LIKE '%6%'
          )
    

    To get a match on all the days, the AND those predicates rather than OR them

    SELECT ... 
     FROM db_schedule d
    WHERE (   d.daysofweek LIKE '%3%'
          AND d.daysofweek LIKE '%4%'  
          AND d.daysofweek LIKE '%6%'
          )
    

    A REGEXP could be used in place of the LIKE. In the case of an “OR” conditions, e.g. to find matches on ‘3’,’4′ or ‘6’:

     WHERE d.daysofweek REGEXP '[346]'
    

    An INSTR function would also work:

     WHERE (  INSTR(d.daysofweek,'3') 
           OR INSTR(d.daysofweek,'4')  
           OR INSTR(d.daysofweek,'6')
           )
    

    Without more detailed information about the exact problem you are facing, it’s really not productive to suggest other solutions.

    But we might point out that there might be more appropriate datatypes for storing daysofweek, the MySQL SET datatype would seem to fit the bill.


    Followup:

    If days of week is stored as a VARCHAR(7), and you want to pass in arguments of ‘Tuesday’, ‘Wednesday’ and ‘Friday’ into a SQL query to perform the search…

    I just don’t understand why you would go to the bother of translating the value(s) returned from the select dropdown box into a character strings like ‘Sunday’, ‘Monday’, etc.

    The values being returned (according to your HTML code, they would be “0” thru “7”), and those already “match” the values stored in the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this code for fill combo-box SQL = SELECT DISTINCT Name,Num FROM MyTbl
I have this form, in which i need to populate a combo box with
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
In my project i have this combo box, and it works perfectly: <%= collection_select
i have this rad combo box (aka dropdownlist) with items count sum max min
am trying to select a multi select combo box. There i have to customize
I have a button , a div and a select combo-box I want to
I have a muilti select combo box like below. i need to store all
I have this value from xml and i have to create a combo box
I have a combo box and drop down items are coming like: <select name=combo1

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.