snk Posted August 24, 2010 Share Posted August 24, 2010 hello everybody, i would like to make a calendar that accepts only 5 reservations per day, thus i need to show how many empty slots are left for each day. When somebody picks a day then some info is filled up (and is written to database) and slot is decreased. I am not sure how to start for it.. I was thinking to put just a table in DB including the date. In printing dates function, when i print a date I make a query to the table on date field with sql count function in order to return how many reservations i have. What considers me is if I am doing it properly. because if i have about 200 reservations then 200 x 30 days x 12 months = 7200 queries. Of course if there is any similar script with what I am going to do i would be very pleased to hear about coz Im not going to reinvent the wheel. I have seen some open source scripts with colors and I was thinking to modify them in order to print slots left rather colors. Thank you in advance for any advice and recommendation. Link to comment https://forums.phpfreaks.com/topic/211635-reservation-calendar-flow/ Share on other sites More sharing options...
Stooney Posted August 24, 2010 Share Posted August 24, 2010 Let's say you're viewing an entire month. You can pull everything you need from the database in 1 query: <?php //Assuming September of 2010 SELECT * FROM table WHERE date='2010-09-%' That will give you everything for the month. Then just use php to sort through it and display it. Link to comment https://forums.phpfreaks.com/topic/211635-reservation-calendar-flow/#findComment-1103293 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.