SHARE
TWEET

Untitled

a guest May 31st, 2015 263 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  <html>
  2. <body>
  3.  
  4.  
  5. <?php
  6.  
  7.  
  8.  
  9.  
  10. $con = mysql_connect("localhost","login","senha");
  11. date_default_timezone_set('America/sao_paulo');
  12. mysql_select_db("b7_16220257_info", $con);
  13.  
  14. $sql="delete t1
  15. from tabela t1
  16. inner join (
  17.    select nome, count(nome)
  18.    from tabela
  19.    group by nome
  20.    having (count(nome) >= 2)
  21. ) as x
  22. on x.nome = t1.nome
  23. where date_add(t1.hora,interval 5 minute) > now()";
  24. if (!mysql_query($sql,$con))
  25.   {
  26.   die('Error: ' . mysql_error());
  27.   }
  28. echo "excluidos repetidos";
  29.  
  30. if (!$con)
  31.   {
  32.   die('Could not connect: ' . mysql_error());
  33.   }
  34. $timezone =    date('y-m-d H:i:s');
  35. echo $timezone;
  36. $nomee = $_REQUEST['nome'];
  37.  
  38. $sql="INSERT INTO tabela (senha,autorizado,nome,Hora)
  39. VALUES
  40. (0,0,'$nomee','$timezone')";
  41.  
  42. if (!mysql_query($sql,$con))
  43.   {
  44.   die('Error: ' . mysql_error());
  45.   }
  46. echo "1 record added";
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. mysql_close($con)
  54. ?>
  55. </body>
  56. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top