php - SQLSTATE[HY093]: Invalid parameter number[ask] -
please me! have trouble error
pdostatement::execute(): sqlstate[hy093]: invalid parameter number: number of bound variables not match number of tokens in
i use query:
public function savestep1($data) $id = intval($data['id']); $query = $this->db->prepare("update `user_general_info` set `soname` = :soname, `last_soname` = :last_soname, `name` = :name, `middle_name` = :middle_name, `birthday` = :birthday, `birthplace` = :birthplace, `city_code` = :city_code, `city` = :city, `street` = :street, `house` = : house, `corp` = :corp, `litera` = :litera, `flat` = :flat `id` = :id"); $query->bindparam(":soname", $data[0], pdo::param_str); $query->bindparam(":last_soname", $data[1], pdo::param_str); $query->bindparam(":name", $data[2], pdo::param_str); $query->bindparam(":middle_name", $data[4], pdo::param_str); $query->bindparam(":birthday", $data[5], pdo::param_str); $query->bindparam(":birthplace", $data[6], pdo::param_str); $query->bindparam(":city_code", $data[7], pdo::param_str); $query->bindparam(":city", $data[8], pdo::param_str); $query->bindparam(":street", $data[9], pdo::param_str); $query->bindparam(":house", $data[10], pdo::param_str); $query->bindparam(":corp", $data[11], pdo::param_str); $query->bindparam(":litera", $data[12], pdo::param_str); $query->bindparam(":flat", $data[13], pdo::param_str); $query->bindparam(":id", $data['id'], pdo::param_int); //print_r($data[0]); return $query->execute();
you have typo in sql statement:
`house` = : house
should be
`house` = :house
Comments
Post a Comment