I'm having difficulty in PHP code to write the date to my database. I have this code,
$data = $_POST ["data"];
$data = date("Y-m-d",strtotime(str_replace('/','-',$data)));
$newslleter = "INSERT INTO newslleter (data) VALUES ('$data')";
However, the date is only recorded in the database if the user enters the format: Year / month / day (Ymd) of the opposite if you type day / month / year (dmY), the date is zeroed. p>