Does anyone know why a drop down select box would insert the wrong value into the database?
Here is my problem: I have a 'month', 'day', and 'year' selection in a form, each in their own drop down box. The selections are to be assigned to variables of the same names (month, day, and year). However, when testing, regardless of what month I choose, the month inserted into the db is always 'December', and the year is always one year below the year selected. The day is always inserted correctly.
For example, if I select July 12, 1987, it inserts it into the db as December 12, 1986. I can't figure out why!
Just some information about how this script is processed: once the form is submitted the information is processed by my 'insert.php' page. That is where I change the variables '$month', '$date', and '$year into the variable '$dob' with the proper UNIX date formatting to get it inserted into the db properly. The code I use for this is:
$dob = date("Y-m-d",mktime(0,0,0,$month,$day,$year));
I don't know if this has anything to do with my problem. But can anyone help me figure out why this is happening?
Thanks!
Jamie