Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $con = mysql_connect("localhost","login","senha");
- date_default_timezone_set('America/sao_paulo');
- mysql_select_db("b7_16220257_info", $con);
- $sql="delete t1
- from tabela t1
- inner join (
- select nome, count(nome)
- from tabela
- group by nome
- having (count(nome) >= 2)
- ) as x
- on x.nome = t1.nome
- where date_add(t1.hora,interval 5 minute) > now()";
- if (!mysql_query($sql,$con))
- {
- die('Error: ' . mysql_error());
- }
- echo "excluidos repetidos";
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- $timezone = date('y-m-d H:i:s');
- echo $timezone;
- $nomee = $_REQUEST['nome'];
- $sql="INSERT INTO tabela (senha,autorizado,nome,Hora)
- VALUES
- (0,0,'$nomee','$timezone')";
- if (!mysql_query($sql,$con))
- {
- die('Error: ' . mysql_error());
- }
- echo "1 record added";
- mysql_close($con)
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement