public function addRecord() { try { $this->setUserIdForDB(); $st = $this->db->prepare("INSERT INTO {$this->table} (`username`, `full_name`, `email`, `password_hash`, `validate_key`, `create_time`) VALUES (:username, :full_name, :email, :password_hash, :validate_key, :create_time)"); $st->execute([':username' => $this->login, ':full_name' => $this->fullName, ':email' => $this->email, ':password_hash' => User::hs($this->password), ':validate_key' => $this->validateKey, ':create_time' => date('Y-m-d H:i:s')]); $this->id = $this->db->lastInsertId(); } catch (Exception $ex) { $ex->getMessage(); } }