PHP help wanted

May 09, 2008 10:12

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... )

Leave a comment

Comments 3

kasumi_astra May 9 2008, 17:12:40 UTC
Hello there.

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

angelofsith May 9 2008, 17:16:56 UTC
I'm using a MySQL to store the appointment information. I probably should have mentioned that.

Reply

mark_jones_jnr May 10 2008, 10:57:35 UTC
It all depends where you want to apply the filter doesn't it?
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

Up