I want to lock users login account every 2 days
i created login_time as timestamp.
The problem is that 2 days has passed but i can still login with the account whereas
the account is suppossed to be lock for every 2 days. its seems there is a problem with the fetch query
Any help
Thank You.
Code:
<?php
//PDO Connection
$statement = $db->prepare('
SELECT id,login_time,username FROM membersuyg58ftplkbv
WHERE username = :username');
$statement->execute(array(
':username' => $txtusername);
// catch id by fetching its database row and lock the account for every 2 days
$catch = $statement->fetch();
if (($catch[0]) > (2 * 24 * 60 * 60)) {
echo 'account lock';
}else{
echo 'login ok';
}
?>
Bookmarks