I'm trying to do a bookingsystem.
If I book the time 06:30:00-19:00:00 will it return.
06:30:00-07:00:00
07:00-00-16:00:00
16:00:00-19:00:00
It will also return the hours between the times and debit code. Does anyone have an example?
CREATE TABLE IF NOT EXISTS `times` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`starttime` time NOT NULL,
`stoptime` time NOT NULL,
`debit` varchar(4) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ;
INSERT INTO `times` (`id`, `starttime`, `stoptime`, `debit`) VALUES
(6, '00:00:00', '06:00:00', 'ot2'),
(7, '06:00:00', '07:00:00', 'ot1'),
(8, '07:00:00', '16:00:00', 'ord'),
(9, '16:00:00', '20:00:00', 'ot1'),
(10, '20:00:00', '24:00:00', 'ot2');