I am running an update script and I'm getting this error:
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens.
Below is my code: class.update.php
public function update($firstname, $lastname, $postaladdress, $mobilephone, $officephone, $personalemail, $officialemail, $nationality, $city, $identity, $id_number, $gender, $dob)
{
try
{
$stmt=$this->db->prepare
("UPDATE clients SET
firstname =:firsname,
lastname =:lastname,
postaladdress =:postaladdress,
mobilephone =:mobilephone,
officephone =:officephone,
personalemail =:personalemail,
officialemail =:officialemail,
nationality =:nationality,
city =:city,
identity =:identiy,
id_number =:id_number,
gender =:gender,
dob =:dob
WHERE client_id=:id");
$stmt->bindparam(":firstname",$firstname);
$stmt->bindparam(":lastname",$lastname);
$stmt->bindparam(":postaladdress",$postaladdress);
$stmt->bindparam(":mobilephone",$mobilephone);
$stmt->bindparam(":officephone",$officephone);
$stmt->bindparam(":personalemail",$personalemail);
$stmt->bindparam(":officialemail",$officialemail);
$stmt->bindparam(":nationality",$nationality);
$stmt->bindparam(":city",$city);
$stmt->bindparam(":identity",$identity);
$stmt->bindparam(":id_number",$id_number);
$stmt->bindparam(":gender",$gender);
$stmt->execute();
return true;
}
catch(PDOException $e)
{
echo $e->getMessage();
return false;
}
}