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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:24:04+00:00 2026-06-07T10:24:04+00:00

I have a site that is based on requests, users can request items, I

  • 0

I have a site that is based on requests, users can request items, I want to restrict some of the requests during certain hours of the day.

For example the user can request item5 only between say 5pm and 8pm. The rest of the time it’s unavailable.

My site is in PHP with a MySQL backend.

Ideally, I would love a function I could call with an item id, the function would check time values from the database and return a true or false value.

It would be much appreciated if someone has some example code, I’ve tried reading up on time in PHP but its fried my head.

  • 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-07T10:24:05+00:00Added an answer on June 7, 2026 at 10:24 am

    You can pop in a startTime and endTime field intot he database using a time() datatype. Into these fields, enter the time they are available from and when they have to be back.

    Then, it is a simple matter for a query to get the available items back.

    tableAvailability
    |--------------------------------|
    | id     | availStart | availEnd |
    |--------------------------------|
    | 1      | 15:00:00   | 18:00:00 |
    | 2      | 12:00:00   | 12:30:00 |
    |--------------------------------|
    
    
    $startTime='15:30:00';
    $requiredTime=2; // Showing Hours for example
    
    $sql="
    select
        id
    from
        tableAvailability
    where
        ".$startTime." >= availStart
        and addTime('".$startTime."', '".$requiredTime.":00:00')<availEnd";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site that i want to redirect all requests accept for 1
I am creating a very large PHP MVC-based site that will have a large
I have a simple web site ( http://www.kousenit.com/twitterfollowervalue ) that computes a quantity based
I have a site that can be accessed both through http (http://mysite.com) and https
I have a site that can allow me to access the mobile version of
I have a site that displays other sites through an iframe on certain pages.
I have a joomla site where users can log in. Once logged in, a
I've got a Django-based site that allows users to register (but requires an admin
In my current .NET and FBML-based facebook app, I have some code that looks
I have a site that has different features and functionality based on the location

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.