-3
public function AlterarDoador(ClasseDoador $AlterarDoador) {
try {
$pdo = conexao::getInstance();
$sql = "UPDATE doador SET nome=?,cpf=?,datadenascimento=?"
. "sexo=?,endereco=?,complemento=?,bairro=?,cidade=?"
. "estado=?,cep=?,email=?,senha=?,telefone=?,perfil=?,datacadastro=? "
. "WHERE iddoador = " . $AlterarDoador->getIddoador() . ";";
$stmt = $pdo->prepare($sql);
$stmt->bindValue(1, $AlterarDoador->getNome());
$stmt->bindValue(2, $AlterarDoador->getCpf());
$stmt->bindValue(3, $AlterarDoador->getDatadenascimento());
$stmt->bindValue(4, $AlterarDoador->getSexo());
$stmt->bindValue(5, $AlterarDoador->getEndereco());
$stmt->bindValue(6, $AlterarDoador->getComplemento());
$stmt->bindValue(7, $AlterarDoador->getBairro());
$stmt->bindValue(8, $AlterarDoador->getCidade());
$stmt->bindValue(9, $AlterarDoador->getEstado());
$stmt->bindValue(10, $AlterarDoador->getCep());
$stmt->bindValue(11, $AlterarDoador->getEmail());
$stmt->bindValue(12, $AlterarDoador->getSenha());
$stmt->bindValue(13, $AlterarDoador->getTelefone());
$stmt->bindValue(14, $AlterarDoador->getPerfil());
$stmt->bindValue(15, $AlterarDoador->getDatacadastro());
return $stmt->execute();
} catch (PDOException $exc) {
echo $exc->getMessage();
}
}
Gabriel well came to stackoverflow, make a tour and see how to create questions, post the error that is occurring.
– Marco Souza
Welcome to the site. In the title of your question, you state that there was an SQL error. What error?
– durtto
There’s a syntax error, missing
,
in some fields look at line breaks– rray
SQLSTATE[42000]: Syntax error or access Violation: 1064 You have an error in your SQL syntax; check the manual that Corresponds to your Mariadb server version for the right syntax to use near '' at line 1
– gabriel da silva
that was the mistake
– gabriel da silva