Why this code...
$curr_time = new DateTime();
$query_inprocess = "UPDATE `MyTable`
SET inprocess=1
WHERE startTime <= '" .$curr_time->format('Y-m-d H:i') . "'";
...results in incorrect SQL query, in which the statement after <
is ignored?
UPDATE `MyTable` SET inprocess=1 WHERE startTime <
Find the below one :
"UPDATE `MyTable` SET inprocess=1 WHERE startTime <= now()"
It may help you to get the exact result which one you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With