Date from php to datatime mysql

I have 3 variables with value: day, month, year
How can I put them in a mysql column of datatime type?
thanks in advance!

Answer 1, authority 100%

datetime – comes in the format (Y.m.d H:i:s)so if you have, say, the string 2011.11.26just add 00:00:00so that your variable is $date = '2011.11.26 00:00:00';and then put it in the database…


$date = 2011.11.26;
$datesnew = $date." 00:00:00";
$datesnew -    ...