This is my PHP code to send a date to MYSQL, but when i open the management tool of my database i get this values: 0000-00-00 00:00:00 Mysql type is set to "datetime".
...
$dataprova = date("Y-m-d H:i:s");
$query = "INSERT INTO oxybet(data) VALUES ('&dataprova')";
if (mysql_query($query)) {
echo "ok";
echo($dataprova);
} else {
echo "error";
}
...
While in my page i correctly obtain: 2014-04-20 15:22:15, db show 0000-00-00 00:00:00
What is the error?
&dataprovaa typo here or in your code as well?&dataprova!==$dataprovasprintf()even.