Page 1 of 1
calendar help!
Posted: Tue May 06, 2008 8:53 am
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?
Re: calendar help!
Posted: Tue May 06, 2008 9:14 am
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!!
Re: calendar help!
Posted: Tue May 06, 2008 10:22 am
by anisland
ok i fixed the unnecessary zeros by using the sprintf function.
Re: calendar help!
Posted: Tue May 06, 2008 10:57 am
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.
Re: calendar help!
Posted: Tue May 06, 2008 11:29 am
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??!!!??