apologies as this seems to me to be a very simple answer, but am struggling to find a solution having searched around.
I have a pretty simplistic table that stores a series of info for booking a caravan - options are one week or two week bookings. I've previously used (and successfully for the last however many years) a simple if else statement to check availability. The weeks are sequential in the database on an auto incremented basis and i simply searched for the next week and a third week as a fail safe by
$next_week_id1 = $row['id'] + 1;
and $next_week_id2 = $row['id'] + 2;
.
Basic I know, but it has worked until now where there has been some kind of discrepancy with the auto increment - I have an id which misses the next incremental value so from id 91 for example it goes to 93, which messes up the whole script.
Its been a while since I touched this, just wondering how you'd hit the next value in the database (for the second week and then the third week) without using the id as an incremental stepping stone? They will always be the next one in the list, but clearly using id+1 or id+2 is a non-reliable way of accessing this...
Thanks for any advice.