01.
public
function
OnlineUpdate(
$user
){
02.
03.
$nowtime
= time();
04.
05.
try{
06.
$stmt
=
$this
->conn->prepare(
"UPDATE pw_logintime SET timer=:pass WHERE user=:usercheck LIMIT 1"
);
07.
$stmt
->execute(
array
(
':usercheck'
=>
$user
,
':pass'
=>
$nowtime
));
08.
$stmt
->close();
09.
$ipaddress_online
=
$_SERVER
[
'REMOTE_ADDR'
];
10.
$stmt
=
$this
->conn->prepare(
"UPDATE pw_logintime SET onlineip=:onlineip2 WHERE user=:usercheck LIMIT 1"
);
11.
$stmt
->execute(
array
(
':usercheck'
=>
$user
,
':onlineip2'
=>
$ipaddress_online
));
12.
}catch(PDOException
$e
){
13.
echo
$e
->getMessage();
14.
}
15.
}