[PHP] Get a list of online characters
#1

Hey! I am interested how to get a list of online chars, well, I tried to look into the online count script, but it uses t_user table, just for count. Have you got any idea bout it?

 

Thanks in advance!

#2

Im not really sure :?

 

The only way I know of atm is from t_users but thats for accounts an wont support single chars

#3

A dirty way to get this would be

 

SELECT a_nick, a_user_index
FROM newproject_db.t_characters c
WHERE a_user_index IN
(
SELECT a_portal_index
FROM newproject_auth.t_users
WHERE a_zone_num != -1
)
AND a_index =
(
SELECT a_index
FROM newproject_db.t_characters
WHERE a_user_index = c.a_user_index
ORDER BY a_datestamp DESC
LIMIT 1
)
GROUP BY a_user_index
But its not really efficient and if u would use this query live and not cachedthen someone could harm your mysql server spam loading this page

#4

Oh thanks guyz! This page would be closed, and will be just for me.

 

Thanks again Wink

#5
Hmm that script just blown my mind lol.

#6
Topic Closed by a moderator. The reason why: Solved, thanks to MaX and Wizatek for help.



Forum Jump:


Users browsing this thread: 1 Guest(s)