2
Guys I have a PHP script that adds another 10 days on 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.
Row 25 referred to in the error is this:
$dt_mod1->modify('+10 days');
Here is the complete section 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");
}
Thanks a lot for your help. I realized that I had made a modification to the main code that recorded the date in the format at’d/m/Y to s H:i:s' and forgot to modify it in the code that was’d/m/Y H:i:s'.
– Carlos