Basically, I have a login system with blocking system. Block if user have used more than 5 attempts, and if he will still attempt, the attempts count will grow.
To delete it, I do this:
"DELETE FROM login_attempts WHERE date < DATE_SUB(NOW(), INTERVAL :time) AND ip_address = :ip"
:time = the interval date
Example:
if ($fetch['attempts'] < 6)
{
$time = "10 MINUTE";
}
else if ($fetch['attempts'] < 10)
{
$time = "1 HOUR";
}
else if ($fetch['attempts'] < 21)
{
$time = "1 DAY";
}
else if ($fetch['attempts'] > 21)
{
$time = "14 DAY";
}
Basically what I am trying to do, I need to find out, how to tell the player when will he get unblocked.
If I know the amount of time when he will be unblocked, how can I echo the time till he gets unblocked? I don't want just to echo the date, I need to echo exactly how many days, hours, etc.
I've never done this, I am stuck at this point.