- Mar 22, 2013
- 9,153
- 10,492
On one page on my site there's a section that shows: "You were last logged in on 31 Dec, 1969 18:00:00 ()."
The date should be updated according to the date/time the user was last logged in.
Here's the code in the php file responsible for this:
Can anyone help me fix this?
Thank you
The date should be updated according to the date/time the user was last logged in.
Here's the code in the php file responsible for this:
PHP:
<?php
echo(ucfirst($user->GetData('UserFirstName').' '));
echo(ucfirst($user->GetData('UserLastName')));
$UserID = $user->GetData('UserID');
$stmt = $pdo->prepare('SELECT * FROM Logs WHERE LogUserID = :LogUserID ORDER BY LogID DESC LIMIT 1');
$stmt->bindParam(':LogUserID', $UserID);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$login_date = $row['LogDate'];
$login_ip_address = $row['LogIPAddress'];
?>
</h1>
<span class="text-muted">
<p>Welcome back, <?php echo(ucfirst($user->GetData('UserName'))); ?>.</p>
<br>
<p>You were last logged in on <b><?php echo(date('d M, Y H:i:s', $login_date)) ?></b> (<b><?php echo($login_ip_address); ?></b>).</p>
</span>
Can anyone help me fix this?
Thank you