DarrenReeder Posted November 30, 2009 Share Posted November 30, 2009 Im trying to make a 'online people' thing on my site that sees who is logged in on the site..i asume i do this by checking which sessions are started and making sure that the name of that sessions is a username in my database..so i need to know how i check all the sessions thats connected to the host Link to comment https://forums.phpfreaks.com/topic/183438-check-if-sessions-are-connected-from-other-pcs/ Share on other sites More sharing options...
Jnerocorp Posted November 30, 2009 Share Posted November 30, 2009 Hello, Well I am guessing that you have a mysql database with a table called users or something close to that where you store the users info like username password email ect... ect... well you need to add another row in that table called "online" then you need to edit your login code to UPDATE "1" into the row called "online" "1" will stand for online and "2" will stand for offline so then you use mysql to ('SELECT * FROM tablename WHERE online="1"') and on the logout code you need to use "UPDATE" mysql to update "2" not insert "2" into the database and on register page you need to insert "2" as a default unless your site auto logs the user in after registering then set it to "1" -John Link to comment https://forums.phpfreaks.com/topic/183438-check-if-sessions-are-connected-from-other-pcs/#findComment-968277 Share on other sites More sharing options...
DarrenReeder Posted November 30, 2009 Author Share Posted November 30, 2009 Thanks John..that makes 100% sense - Once someone told me it all makes sense and i dont know how i didnt think of it before ....I was thinking too technical and forgetting about the simple things like that... Thanks!! Link to comment https://forums.phpfreaks.com/topic/183438-check-if-sessions-are-connected-from-other-pcs/#findComment-968281 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.