Forum Moderators: coopster
At the moment I have the reservations in an database table, I have arrival in one column and departures in another column, both date types.
Anybody know how to do the script for the web, or at least give me an idea on where to start....
SELECT count(*) FROM table WHERE arrival < '$calendar_date' AND departure > '$calendar_date'
Here I'm assuming first setting:
$calendar_date = 'ccyy-mm-dd'; // date you want to find occupancy for.
The result from this should give you the occupancy count for $calendar_date. Subtract that from whatever the total is, and it should give you the number of availabilities.
Depending on when your changeover time is, you might need to use <= and/or >= instead of < and >.
I hope this helps.