-2
I’m having trouble with PHP code to record the date in 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 in case the user dies within the Input format: Year/month/day (Y-m-d) of the opposite type day/month/year (d-m-Y) the date is reset.
Possible duplicate of How to insert dates into a database table using PHP?
– Victor Eyer