0
Out of nowhere began a problem I found no explanation. Follow my code, explaining the problem.
Here I receive the data:
$venda = $_POST['f_venda']; //Sim
$preco_venda = $_POST['f_preco_venda']; //360000
$imovel = $_POST['f_imovel']; //2564
$real = 'R$ ' . number_format($preco_venda, 2, ',', '.'); // R$360.000,00
Here I write the data in the table and the problem occurs. The sales field should be updated to 360000, but is recording the number 1, and the sales field should be changed to Yes, but remains in No:
$sql_preco_venda = "UPDATE imoveis SET preco = '$preco_venda' AND venda = '$venda' WHERE controle LIKE '$imovel'";
mysqli_query($connection, $sql_preco_venda);
In these two INSERTS the fields are recorded correctly, that is, $sale records Yes and $real records R$360.000,00:
$sql_rastros = "INSERT INTO rastros VALUES ('0', '$user_nome', now(), now(), 'alterou opção ($venda) e preço de venda do imóvel código $cod_int para $real')";
mysqli_query($connection, $sql_rastros);
$sql_historia = "INSERT INTO historia VALUES ('0', '$user_nome', now(), '$imovel', 'Opção ($venda) e preço de venda alterado para $real')";
mysqli_query($connection, $sql_historia);
I’ve really tried everything and I haven’t detected the error. I appreciate your help.
Try removing AND and adding only a COMMA (,) to your UPDATE.
– viana