I am really struggling with something that should be simple.
I have a form which asks for a date entry. This date entry is assigned to variable and then formatted suitable for MySQL entry.
But the resulting date in MySQL is incorrect.
I have even tried assigning directly.
e.g.
$date = '2001-04-18'
$db_connect->query("INSERT INTO $sql_usertable (date) VALUES ('$date')");
The result from MySQL is 2018-04-20.
If I perform the following:-
$db_connect->query("INSERT INTO $sql_usertable (date) VALUES ('2001-04-18')");
It works fine.
Any suggestions would be helpful!
Thanks in advance
Robin.