I save users sing-in information using the fields below:
user_id, login_date, login_time, status
After each attempting for sign-in, a record will insert into database using true or false status. I want to lock user if he/she has 3 failed logins in the last 3 minutes. So I need to use the current time and calculate its difference with 3 last records of table in minute format.
My questions are:
1- Which one is better to do this time calculation? PHP or MySQL?
2- Depends on your suggestion, which function is better for it?
Thank you.