查询没有执行,我不知道为什么
这是我的尝试
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>发布于 2013-05-15 21:04:05
尝试这个(分钟而不是分钟):
sql_query("DELETE FROM login_attempts WHERE time < NOW() - INTERVAL 2 MINUTE");发布于 2013-05-15 21:05:58
我认为你的语法是错误的。
尝试按分钟替换分钟
"DELETE FROM login_attempts WHERE time < NOW() - INTERVAL 2“
如果没有帮助,在这里发布你的MySQL错误。
希望能有所帮助。
https://stackoverflow.com/questions/16565596
复制相似问题