So I'm doing a URL that expires and here's a some code
//DB query
$stmt = $con->prepare("SELECT token_created_at from reset WHERE token = :urltoken");
$stmt->bindValue(':urltoken', $_GET['token']);
$stmt->execute();
$stmt->setFetchMode(PDO::FETCH_ASSOC);
while($row = $stmt->fetch()) {
$token_created_at = $row['token_created_at'];
}
$expires_at = $token_created_at->modify('+1 hour');
//Return current time to match
$current_time = date('m-d-Y H:i:s ', time());
The issue is here's the error I get
( ! ) Fatal error: Call to a member function modify() on a non-object in /Users/matt/Desktop/Likes/forgot/activate.php on line 18
Line 18 is
$expires_at = $token_created_at->modify('+1 hour');
So if I can't do it this way, how would I do it?