kknixx Posted April 18, 2008 Share Posted April 18, 2008 Just started with php and mysql. Im doing a hotel room reservation system for some 100 rooms. Customers come and register for room(s) between some date(check in) and some date(check out). I need to check for the availability of rooms specifically on these days. If not already allocated the rooms will be allocated for him. I have created a mysql table with following fileds username email checkin checkout roomsrequired am not sure whether i require another table to manipulate the datas. I have no idea how to start with. any suggestions or help will be highly appreciated. Link to comment https://forums.phpfreaks.com/topic/101634-dates-in-mysql-and-related-issue/ Share on other sites More sharing options...
ohdang888 Posted April 18, 2008 Share Posted April 18, 2008 are you learning this as a hobby? I would start with something easier... that system as a lot of stuff to search through. it would require at least 3-4 tables... and it uses dates, which is something that normally does not come to people very easily. Link to comment https://forums.phpfreaks.com/topic/101634-dates-in-mysql-and-related-issue/#findComment-520026 Share on other sites More sharing options...
kknixx Posted April 18, 2008 Author Share Posted April 18, 2008 I have basic knowledge to connect to mysql retrieve & update records. yes am doing this as hobby. I dont want to do any payment process, its going to be just a demo. I have form ready and number of days in between calculated. But somehow not able to proceed further Link to comment https://forums.phpfreaks.com/topic/101634-dates-in-mysql-and-related-issue/#findComment-520045 Share on other sites More sharing options...
ohdang888 Posted April 18, 2008 Share Posted April 18, 2008 to search for 1 day: SELECT SUM(roomsrequired) FROM table WHERE what ever the date syntax is it's probably something like WHERE $date > checkin AND $date < checkout or: WHERE $date < checkin AND $date > checkout if($row['SUM(roomsrequired)'] > 100) { echo 'No More Rooms '; } Link to comment https://forums.phpfreaks.com/topic/101634-dates-in-mysql-and-related-issue/#findComment-520052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.