Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "conexao.php";
- $nome = strip_tags($_POST['nome']);
- $pesquisar = mysql_query("SELECT * FROM listaredxote WHERE nome = '$nome'"); //verifica se existe $nome na tabela
- $contagem = mysql_num_rows($pesquisar); //conta em quantas linhas o $nome ja existe
- if($nome != "" && $contagem != 1){
- mysql_query("INSERT INTO listaredxote (nome) VALUES ('$nome')");
- echo "Cadastrado com sucesso";
- }
- ?>
Add Comment
Please, Sign In to add comment