Вам не хватает:
$stmt->bindparam(":dob",$dob);
$stmt->bindparam(":id",$id);
И, возможно, параметр $id
в вашей функции:
public function update($firstname, $lastname, etc etc etc, $id)
Полный код должен быть (при условии, что $id
является параметромдля update()
):
public function update($firstname, $lastname, $postaladdress, $mobilephone, $officephone, $personalemail, $officialemail, $nationality, $city, $identity, $id_number, $gender, $dob, $id)
{
try
{
$stmt=$this->db->prepare
("UPDATE clients SET
firstname =:firstname,
lastname =:lastname,
postaladdress =:postaladdress,
mobilephone =:mobilephone,
officephone =:officephone,
personalemail =:personalemail,
officialemail =:officialemail,
nationality =:nationality,
city =:city,
identity =:identity,
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->bindparam(":dob",$dob);
$stmt->bindparam(":id",$id);
$stmt->execute();
return true;
}
catch(PDOException $e)
{
echo $e->getMessage();
return false;
}
}