loquela Posted June 4, 2009 Share Posted June 4, 2009 I've got a logic puzzle that has got me completelly foxed and I would REALLY appreciate some help. I am working on a room availability date checker. I have a table 'booked_rooms' with four fields: id room_id arrival_date departure_date I am trying to figure out the select statement that will list all the rooms that are available on and between between two given dates. Any takers? ??? Many thanks in advance. S. Link to comment https://forums.phpfreaks.com/topic/160970-available-dates-logic/ Share on other sites More sharing options...
Maq Posted June 4, 2009 Share Posted June 4, 2009 What format is '$arrival_date' and $departure_date' in? You can do something like: SELECT * FROM table WHERE date_field BETWEEN '$arrival_date' AND '$departure_date'; Link to comment https://forums.phpfreaks.com/topic/160970-available-dates-logic/#findComment-849564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.