title: automatic delete of mysql table data after 2 minutes
body: <p>the query is not executed i don't know why </p>
  
  <p>here is my try</p>
  
  <p>i use this code to delete login attempts record and ip  from the tabel after 2 min to allow user to try login again </p>
  
  <p>if another soultion is better than this please submit it </p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="content-type" content="text/html" /&gt;
      &lt;meta name="author" content="gencyolcu" /&gt;
  
      &lt;title&gt;Untitled 1&lt;/title&gt;
  &lt;/head&gt;
  &lt;style&gt;
  .fall
  {
      background-color: aliceblue;
      color: darkkhaki;
      width: 400px;
      height: 200px;
      margin-top: 200px;
      padding: 200px;
      margin-left: 200px;
  }
  #txt
  {
      font-family: fantasy;
      font-size: xx-large;
      font-style: italic;
  }
  &lt;/style&gt;
  &lt;body&gt;
  
  &lt;div class="fall"&gt;
   &lt;p id="txt"&gt;You have exceeded the allowed  login times try again 
  &lt;/p&gt;
  &lt;/div&gt;
  &lt;?php
  $con = mysql_connect("localhost","root","");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  mysql_select_db("register_form", $con);
  
  
  mysql_query("DELETE FROM login_attempts WHERE time &lt; NOW() - INTERVAL 2 minutes");
  
  mysql_close($con);
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>