I want to insert to mysql a date filed with pdo.
The format of the date variable is 09-13-2011 17:11:09 as I see with die($date)
Also I use this code
$sth = $dbh->prepare($sql);
But nothing is inserting at my db.
What is wrong?
Hello, on how i remember right format must be "year-month-day hour:minute:seconds". hope it help you.
Yes, as inky states, the correct format (in PHP's Date-String) is Y-m-d H:i:s (or YYYY-MM-DD HH:MM:SS).