I have managed to combine the values of 3 drop down menus year, month and day and store the result in a variable.
If I choose from the menus and echo the variable it I get, as an example -
echo $dateRequired; output is 2017-10-20
My problem is getting this value into my MySQL database
$query = "INSERT INTO newsletters(filename, document_name, document_type, description, upload_date, size) ";
$query .= " VALUES('{$filename}', '{$document_name}', '{$document_type}', '{$description}', '{$dateRequired}', {$size})";
I tried $dateRequired = date("Y-m-d", strtotime($dateRequired));
However this inserts the date as the UNIX Epoch 1970-01-01
The date column in my database is set to DATE
Best regards Maxwell