SQL Fiddle
DROP TABLE IF EXISTS `booked_dates`;
CREATE TABLE IF NOT EXISTS `booked_dates` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
`user_id` INT(11) UNSIGNED NULL DEFAULT NULL COMMENT 'User ID - FK to users',
`booked_date` DATE NULL DEFAULT '0000-00-00' COMMENT 'Date Booked',
PRIMARY KEY (`id`),
KEY `idx_booked_date` (`booked_date`),
KEY `idx_user_id` (`user_id`)
)
ENGINE=MyISAM
AUTO_INCREMENT=1
DEFAULT CHARSET=utf8
COLLATE=utf8_unicode_ci
COMMENT '';
INSERT INTO `booked_dates`
(`user_id`,`booked_date`)
VALUES
(2, '2018-07-08'),
(2, '2018-07-09'),
(2, '2018-07-10'),
(2, '2018-07-11'),
(2, '2018-07-12'),
(2, '2018-07-15'),
(2, '2018-07-17');
SELECT
a.`booked_date`,
a.`booked_date` as `d1`,
b.`booked_date` as `d2`,
DATE_ADD(a.`booked_date`,INTERVAL 1 DAY) as `First Available`,
DATEDIFF(b.`booked_date`,a.`booked_date`) as `date diff`
FROM `booked_dates` a
JOIN `booked_dates` b
ON a.`booked_date` < b.`booked_date`
GROUP BY a.`booked_date`
HAVING `date diff` > 1
Results
| booked_date | d1 | d2 | First Available | date diff |
|-------------|------------|------------|-----------------|-----------|
| 2018-07-12 | 2018-07-12 | 2018-07-15 | 2018-07-13 | 3 |
| 2018-07-15 | 2018-07-15 | 2018-07-17 | 2018-07-16 | 2 |