I know there's a lot of booking questions on php section. Belive me when i tell you that I tried most of them, at least those which seems compatible. So let me explain.
I have this appointments table
ID | day | start | end |
----------------------------------
1 | 01-01-2018 | 09:00 | 10:00 |
2 | 01-01-2018 | 10:00 | 13:00 |
3 | 02-01-2018 | 12:00 | 15:00 |
4 | 02-01-2018 | 18:00 | 19:30 |
I was wondering, it possibile with sql to get empty time slots? The result should like something like:
day | start | end
---------------------------
01-01-2018 | 00:00 | 09:00
01-01-2018 | 13:00 | 23:59
02-01-2018 | 00:00 | 12:00
02-01-2018 | 15:00 | 18:00
02-01-2018 | 19:30 | 23:59
The query should contain 2 dates: start_day + end_day
I prepared a fiddle here: https://www.db-fiddle.com/f/6dm8q8UtmDkkkjExYfMEbx/1