Error query update set

Asked

Viewed 34 times

0

To $query1 and $query2 work, but the $query1a update is not setting, can anyone tell if it is syntax error?

$conexao = mysqli_connect('localhost','rr','4ai','rr') or die('Erro ao conectar ao banco de dados');


$query1 = "INSERT INTO sac (data,nome,email,empresa,telefone,cidade,assunto,categoria,mensagem) VALUES (now(),'$nome','$email','$empresa','$telefone','$cidade','$assunto','$categoria','$mensagem')";
    mysqli_query($conexao,$query1);

$d = date("dmY");
$id = mysqli_insert_id($conexao);
$prot = "SAC".$d.$id; 
//echo $id;


$query1a = "UPDATE sac SET protocolo=$prot WHERE id=$id";
    mysqli_query($conexao,$query1a) or die ('erro cadastrar proto');


$query2 = "INSERT INTO status (solicitacao_solistatus,status_solistatus,setor,data_solistatus,resposta) VALUES ('$id','Em andamento','SAC',now(),'$resposta')";
    mysqli_query($conexao,$query2);
  • Is there an error? If so, what is the error?

  • make a echo $query1a; sql is correct? Test on phpMyAdmin workbanch or something

1 answer

1

Only missing quotes '' in $Prot variable Thanks there to those who answered, vlw

Browser other questions tagged

You are not signed in. Login or sign up in order to post.