1
I am having a small problem and would like help to solve it. I have a code that makes the insertion into a SQL SERVER database through php. Everything is fine, except that two "INSERT" in the bank are being made. I can’t see what’s wrong, so I wish someone could help me
The $upload variable is triggered as soon as the form is sent. I don’t 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);
}
Double click on Ubmit? You can use email as Unique key to avoid duplicate records.
– rray
This question already has answer somewhere, let me look for the link.
– Edilson
The only problem was that the user did not choose an answer, so he was unable to mark it as repeated/related - http://answall.com/questions/10744/como-n%C3%A3o-record-duplicate-in-mysql-com-php/10745#10745
– Edilson