Answer the question
In order to leave comments, you need to log in
How to get a property available for booking on the specified days?
There is a certain table available , in which the admin indicates the days on which you can rent a property. There is a field from (starting from), to (last day) and there is a property_id field (this is actually the property id). It is not unique; accordingly, there may be several dates for the availability of housing. They may intersect. So, the question itself is: how to get a property available for booking on the specified days, given the fact that the records can overlap? Example:
from to property_id
2020-12-27 2021-01-08 1
2021-01-06 2021-01-15 1
Answer the question
In order to leave comments, you need to log in
In short, the best option is to either do it so that there is no "overlay" of dates on each other, or simply use this table to store "busy" days (for example, for cleaning, etc.)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question