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.
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.