View Single Post
Old 23.10.2007, 22:00   #6
FidoW
Guest
 
Posts: n/a
Default script for clear online after server crushes

3 things...

First... there is one thing in your PHP code have no sense....

PHP Code:

php buffer start
$res1=mssql_query("SELECT COUNT(auth_ip) AS cnt , auth_ip
FROM lin2db.dbo.user_account
WHERE (last_login > last_logout) GROUP BY auth_ip");

$online_dyxs=array();

php buffer end

WTF ?! That code is... shit.. do nothing... you can delete it... and.. WTF!! auth_ip ? that remember me to some addon of hint proxy

Second... you dont need never, except when Cached start to do that, inserting the query in the store proc is enought...

And third... that query forgot about one case...

A new player is created... so... last_logout IS NULL!!... isnt going to be updated never that way....

Code:

Code:
UPDATE user_data SET logout = GETDATE() WHERE (login > logout) OR (login IS NOT NULL and logout IS NULL)
Now is done Smile

Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. В снимке указана только дата, без времени: 24 October 2007. Открыть источник.