I'm having a little problem and would like help solving it. I have a code that inserts into a SQL SERVER database through php. Everything is fine except that two "INSERT" on the bench are being made. I can not see what is wrong, so I wish someone could help me
The $ dispatch variable is triggered once the form is submitted. I do not even know why this double INSERT: (
if($envio){
$pastaupload = 'candidatos/';
$arquivoupload = $pastaupload . time() . $_FILES['arquivo']['name'];
move_uploaded_file($_FILES['arquivo']['tmp_name'], $arquivoupload );
$caminho = "http://meusite.com.br/".$arquivoupload;
$insert ="INSERT INTO CANDIDATO (NOME, DH_NASCIMENTO, CEP, ENDERECO, NUMERO, BAIRRO, MUNICIPIO, UF, TELEFONE, CELULAR, EMAIL, CD_SEGMENTO_CARGO, OBSERVACAO, PATH_CURRICULO, CD_STATUS, CD_USUARIO) VALUES ('$nome', '$datanascimento', '$cep', '$endereco', '$numero', '$bairro', '$cidade', '$uf', '$telefone', '$celular', '$email', $segmento, '$observacoes', '$caminho', 1, 12 )";
mssql_query($insert);
mssql_close($connection);
}