calendar help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
anisland
Forum Newbie
Posts: 5
Joined: Tue May 06, 2008 8:50 am

calendar help!

Post by anisland »

hello i have created a calendar that creates appointments and saves them into a mysql database, however im having a problem. Say i made an appointment at 2 oclock, i dont want another person to be able to set an appointment at 2. How would i do this?
anisland
Forum Newbie
Posts: 5
Joined: Tue May 06, 2008 8:50 am

Re: calendar help!

Post by anisland »

ok ive about got it figured out, now can someone help me out with something small....
this is how im getting date and times from mysql ... 2008-05-07 01:00:00

can some one tell me how to remove the unnecessary zeros in front of the month day and hour!

THX!!
anisland
Forum Newbie
Posts: 5
Joined: Tue May 06, 2008 8:50 am

Re: calendar help!

Post by anisland »

ok i fixed the unnecessary zeros by using the sprintf function.
anisland
Forum Newbie
Posts: 5
Joined: Tue May 06, 2008 8:50 am

Re: calendar help!

Post by anisland »

ok now another problem has arrised, in my if statement i compare the the time in the mysql database to the time the user submits, and if the time is the same it comes back and says select another time. However the if statement is only comparing the user input to the first appointment made for that day, i need it to look at every appointment for that day. How would i go about doing this? any help is appreciated.
anisland
Forum Newbie
Posts: 5
Joined: Tue May 06, 2008 8:50 am

Re: calendar help!

Post by anisland »

ok i guess an easier way to explain this is to ask how would i go about comparing one variable to a list of strings to see if atleast one of them are equal to each other?

example...

if ($one == $alist){
do this
} else {
do something else
}

But $one only has to be equal to one of the strings in the list.

Help please??!!!??
Post Reply