$qry = "SELECT user, TIME_FORMAT(last_login_time, '%H:%i') FROM login_attempts WHERE user = '".$username."'";
$result = mysql_query($qry,$this->connection);
if(!$result || mysql_num_rows($result) <= 0){
mysql_query ("INSERT INTO login_attempts(userid, user, attempts, last_login_time) VALUES('', '$username', '{$_SESSION['count']}', '{$_SESSION['login_time']}')");
}
else{
$row = mysql_fetch_assoc($result);
$_SESSION['login_time'] = $row["last_login_time"];
mysql_query ("UPDATE login_attempts SET attempts = '" .$_SESSION['count']."' WHERE user = '".$username."'");
}
在上面的代码中,我将我的$_SESSION['login_time']
值存储login_attempts
在列名为“last_login_time”的“”表中。
现在我需要获取该值并将其存储回$_SESSION['login_time']
数组中,以便了解用户上次尝试输入的时间。我该如何获取这个值???
列的数据类型'last_login_time'
是'timestamp'.