ah, no hiding place..
yes it comes from db..
but the whole task is to check if a sequence of bookings made by one person, when added together, add to more than 6 months
so there could be many bookings (of one week for example) and if it is all contiguous and adds to more than 6 months...
also bookings could be added out of date order so I have to base the search by looking back and looking forwards
so I figured the best way was get all the bookings into a php array, then based off the central one that is being examined, see which ones had contiguous (or overlapping) dates [actually there can't be any overlapping dates as that is checked in another code block but it seemed safer to leave it in]
then if a match is found check that item's dates
so now I've got the date range extremes and I then look to see if it's over the (illogical) 6 month specification
which led me to make the first post..
I bet there is a really cool single query bit of Sql but it's beyond me!