Personal I have a PHP script that adds another 10 days to a date. The script was working wonderfully well, however, a few days ago I started getting the following error:
PHP Fatal error: Uncaught Error: Call to a member function modify () on boolean ... line 25.
Line 25 referred to in the error is this:
$dt_mod1->modify('+10 days');
Here is the complete snippet related to this line:
$dt_mod1 = DateTime::createFromFormat('d/m/Y H:i:s', $dt_mod);
$dt_mod1->modify('+10 days');
$dt_mod2 = $dt_mod1->format('d/m/Y');
if ($dt_mod2 == $data_atual ){
mysqli_query($conexao, "UPDATE 'cadastro' SET 'situacao' = 'CANCELADA' WHERE 'cadastro'.'codigo' = $codigo");
mysqli_query($conexao, "UPDATE 'cadastro' SET 'dt_mod' = '$data_atual' WHERE 'cadastro'.'codigo' = $codigo");
}