Hi I have the following code which seem to just want to not work, I have done code the same which has worked fine before so I don't quite know why it is not working now. It returns the error: "Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number in... "
This is the Php pdo function I call to edit the database:
public function update_email_validation($params)
{
$stmt = $this->conn->prepare('
UPDATE email_validation
SET status=:status
WHERE email=:email
AND hash=:hash
AND status!=:status
LIMIT 1');
$stmt->bindParam(':status', $params['status'], PDO::PARAM_INT);
$stmt->bindParam(':email', $params['email'], PDO::PARAM_STR);
$stmt->bindParam(':hash', $params['hash'], PDO::PARAM_STR);
$stmt->execute();
return $stmt->rowCount();
}
And then this is the call from php passing the array along:
if ($db->update_email_validation(
['status' => 1,
'email' => $params['email'],
'hash' => $params['hash']]
) == 0)
{
}
thanks in advance.