I'm having some problems with PHP. I'm writing a calender website and the problem I'm having is with the appointment making page. What I want it to do is query a database of appointments using a given date, if there's no appointment at that time I want it to echo the time as an option in a list, but if there is an appointment then I don't want
(
Read more... )
Comments 3
I'd suggest setting up a similar table of appointment slots, which would list all available appointments in a day whether they were booked or not. You could use this to build your select list from, and use the records found in your appointments table to discount slot options to show. You could also use the slot records to supply the start and end times of your appointments when creating a new appointment record.
You don't have to use a table for appointment slots necessarily, you could have a static list object defined in your script instead. Either way, what you want is a reference of all possible times and durations for appointments to take place ;-)
Reply
Reply
Do it in SQL?
Do it with two sets of results in PHP - while it's writing the option list?
I'd rule out writing it on the client in JavaScript. =)
Reply
Leave a comment