0

查询未执行我不知道为什么

这是我的尝试

我使用此代码在 2 分钟后从表中删除登录尝试记录和 ip,以允许用户再次尝试登录

如果另一个灵魂比这更好,请提交

<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="content-type" content="text/html" />
    <meta name="author" content="gencyolcu" />

    <title>Untitled 1</title>
</head>
<style>
.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;
}
</style>
<body>

<div class="fall">
 <p id="txt">You have exceeded the allowed  login times try again 
</p>
</div>
<?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 < NOW() - INTERVAL 2 minutes");

mysql_close($con);
?>
</body>
</html>
4

2 回答 2

1

试试这个(分钟而不是分钟):

sql_query("DELETE FROM login_attempts WHERE time < NOW() -  INTERVAL 2 MINUTE");
于 2013-05-15T13:04:05.193 回答
0

我认为你的语法是错误的。

尝试将 MINUTES 替换为 MINUTE

“从登录尝试中删除时间 <现在() - 间隔 2分钟

如果没有帮助,请在此处发布您的 MySQL 错误。

希望能帮助到你。

于 2013-05-15T13:05:57.977 回答