Q:

Incorrect datetime value: '31-01-2013' for column 'user_date' at row 1

$query_insert = "INSERT INTO users (user_name, user_pass, user_email, user_date, user_level, user_posts)
                        VALUES(?,?,?,?,?,?)";
$insert = $mysqli->prepare($query_insert);
                $insert->bind_param("ssssii", $username, $password_enc, $email, $date, $level_start, $post_start);
                $insert->execute();
$date = date('d-m-Y');

Those are the related parts. The only thing is...when i execute this it doesnt add to the table
I had a look around and someone said to have $insert->error; so I put that in and this came up
Incorrect datetime value: '31-01-2013' for column 'user_date' at row 1

Anybody able to help?

A:

It has to be 2013-01-31, i.e. date('Y-m-d')
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-types.html

