I have tried a large number of "solutions" to this but everytime I use them I see 0000-00-00 in my date field instead of the date even though I echoed and can see that the date looks correct.
Here's where I'm at:
I have a drop down for the month (1-12) and date fields (1-31) as well as a text input field for the year. Using the POST array, I have combined them into the xxxx-xx-xx format that I am using in my field as a date field in mysql.
<code>
$date_value =$_POST['year'].'-'.$_POST['month'].'-'.$_POST['day'];
echo $date_value;
</code>
This outputs 2012-5-7 in my test echo but 0000-00-00 in the database.
I have tried unsuccessfully to use in a numberof suggested versions of:
strtotime()
mktime
Any help would be extremely appreciated.
I am aware that I need to validate this data and insure that it is a valid date. That I'm okay with. I would like some help on getting it into the database.