I am trying to update some data in my DB via:
if($stmt = $connection->prepare("UPDATE `booking` SET status = ?, datecreated = ? WHERE day = ? AND timeSlot = ?")){
$stmt->bind_param('ssss', 'processing', 'now()', $results[0]['timeSlot'], $results[0]['day']);
$stmt->execute();
$stmt->close();
echo 'Updated';
}
When I run this I get the following error:
Fatal error: Cannot pass parameter 2 by reference
The column datecreated
is a datetime type.
I have tried now() and 'now()' and date('Y-m-d H:i:s') all 3 give me the same error.