0
I would like to request assistance from you identifying why my update query does not work. I have the following problem, the query below works normally:
$conn->query("UPDATE dados_cadastrais SET
nome='$nome',sobrenome='$sobrenome',nascimento='$nascimento',cpf='$cpf',cep='$cep',logradouro='$logradouro',bairro='$bairro',localidade='$localidade',uf='$uf',ibge='$ibge',numero='$numero',usuario='$usuario',senha='$senha'")
But there it is without the WHERE clause pointed out, but when I put it, it does not recognize as part of the query the WHERE or anything after it, I’ve tried everything and I can’t find where the error is(if there is any error), or some other way to do it, follows image of how it looks in the text editor (I use Atom):
Thanks in advance for the help, because I’ve researched everything possible and found nothing like my problem.
Never do that again in your life, if a user catches your system or website makes a good SQL Injection. Use PDO to solve your problem with database connection and instead of passing parameters use bindParam() Function. http://php.net/manual/en/pdostatement.bindparam.php
– Marcus Pereira
yes for sure, you can rest assured that this is only place for study really, but I’ll take a look at this Function and I’ll tell you if it worked, but thanks for now
– Luiz Gustavo
missing put the variable $id between quotation marks as well
where id='$id'
– user60252
password='$password' WHERE Id='". $Id."'");
– user60252
in my updates both work
– user60252