query update error

0

The $query1 and $query2 work, but the $query1a update is not set, does anyone know if it is a 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);
    
asked by anonymous 21.05.2018 / 15:37

1 answer

1

Only missing quotes in '$ prot variable Thank you to those who answered, vlw

    
21.05.2018 / 15:51