如何在mysql中设置定时器并在定时器设置为00:00:00后更新字段?

时间:2017-12-16 09:20:00

标签: mysql jsp

当客户连续3次输入错误密码时,我正在处理网上银行项目,我希望帐户被锁定2小时 如何用mysql实现这个?

2 个答案:

答案 0 :(得分:1)

存储错误输入密码的时间并检查访问帐户时的时差

答案 1 :(得分:0)

在发布问题之前,您是否找到了答案?

以下答案很有用:

https://stackoverflow.com/a/27019922/793934

其摘要是您可以使用Select b.Id as BatchId, b.CourseId as CourseId, b.BatchNumber as BatchNumber, b.BatchTimingsFrom as BatchTimingsFrom, b.BatchTimingsTo as BatchTimingsTo, b.BatchDuration as Duration, b.BatchDate as BatchDate, b."Days" as "Days", b.CourseRoomId as CourseRoomId, c.CourseName as CourseName, cr.RoomName as RoomName, cr.RoomCapacity as RoomCapacity ,COUNT(*) OVER (PARTITION BY b.Id) countstudentinBatches from dbo."Batches" b INNER JOIN dbo.Courses c ON b.CourseId = c.Id INNER JOIN dbo.CourseRooms cr ON b.CourseRoomId = cr.Id INNER JOIN dbo.StudentBatchRelation sr ON sr.BatchId = b.Id WHERE b.ActiveBatch = 1 个事件。当然,您可以手动并独立于数据库来管理情境。您必须将时间存储在错误的密码上,然后将当前时间与存储的时间进行比较。