Stop if there is a gap

Hi guys

I have a little problem which I hope can be solved

I have a start time say

8am

I want to display the next times so like this

9am
10am
11am

and so on. However if there is a row which is set as confirmed I do not want it to show, that is no problem. The issue is it then shows the next rows after so it would be like this if 10am and 11am were booked

9am
12m
1pm

I need the query to stop when it hits a row which is confirmed

SELECT * FROM bookings WHERE Date_Of_Actual_Booking >= '2010-07-15 09:00:00' AND Status!='Confirmed' and Dates_ID='19' ORDER BY Date_Of_Actual_Booking ASC Limit 1,10 

Thanks in advance

depending how the confirmation takes place you could have an extra field for example isConfirmd tinyint(1) default 0 and then when it is confirmed set the field to 1

In your where clause where isConfirmed = 0;

i have a better idea, why don’t you do this in your application code, i.e. stop displaying when you hit a gap