I am trying to achieve something like this.
**First user:**
Check-in date: 2020-08-12
Check-out date: 2020-08-19
**Second user:**
Check-in date: 2020-08-13
Check-out date: 2020-08-18
Error message for the second user will be: Dates have already been booked.
i tried to come up with a statement below,
$sql = "
SELECT count(*)
FROM $TableName
where prop_ID = $pid
AND checkInDate <= '$checkin'
AND checkoutDate >= '$checkout'
";
However, the above statement only checks for its date for check-in and check out and not the dates between.
Anyone who can help will be of great help! Thanks in advance!