473,654 Members | 3,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User online or offline

150 New Member
I'm making chat room in my site but i'm having problem with the recent messages from the user in the database, i need to know if the user online or offline how can i know that by PHP to clear the data after he signout or offline?
Nov 24 '07 #1
1 2700
Markus
6,050 Recognized Expert Expert
I'm making chat room in my site but i'm having problem with the recent messages from the user in the database, i need to know if the user online or offline how can i know that by PHP to clear the data after he signout or offline?
The only way you could do that is by using a MySQL DataBase

1) when the user logs in, update the ''status' row to 'online' and insert the time the user logged in into 'login_time'
1.2)Run mysql query to check if the status is 'online'
1.3) code for online user --
2)When the user logs out (if he/she logs out) update 'status' to 'offline'
2.1)if user doesnt log out: run script (1.2) if user is 'online' check to see if 'login_time' was over an hour ago and if so update 'status' to 'offline' and run appropriate script.
Nov 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
19480
by: Mark S | last post by:
I have a db maintenance plan which is set to backup (then truncate hopefully) the transaction log. In order to backup a transaction log the db must be in single user mode so the maint. plan fails. How do you automatically set the db, in single user mode, for the transaction log to be backed up then truncated? Also, I manually set the db in single user mode and it shows itself to be in single user mode yet the number of users in the db...
2
2544
by: John Baker | last post by:
I find it highly annoying that MS Access tries to go online when I want to look at the help files. Is there a way to configure it so it just looks at my local helpfiles when I hit F1?
2
1626
by: John | last post by:
Hi I need to write a vb2005/sql server2005 app running over a LAN. Some users who use laptop need to have the app to have an offline mode for when they are away. I am new to net and would like to know what will be the differences in the online-only and online/offline versions of the app? As not all users need it, is it possible to configure the app so it knows when it is in desktop (online-only) or laptop modes? Thanks
4
9465
by: manwiththeaxe.70 | last post by:
I have recently begun to migrate our DB2 UDB v7.2 enterprise databases up to DB2 UDB v8.2. One question I can't seem to understand is why would I want to run an offline backup for a database now that the online backup includes the necessary log files. Is there a reason why I would need or want to go through the hassle of getting exclusive control of a db for an offline backup?
3
6909
by: Alex | last post by:
Hello, I am running an Access 2003 database, quite modest in size, that is used by upwards of 5 users. I need to modify the database such that these users can work simultaneously and, in some cases, offline. It is split to front and back ends and works over Citrix. So the multi-user is working fine.
10
3166
by: Konstantin Andreev | last post by:
Hello. Some time ago I asked in this conference, - How to use an ONLINE BACKUP to restore database onto another system? - but got no answers. Therefore I can conclude it is not possible. But... what can I do with "online backup", really ? What is it needed for ? I do not see any possibility to use this backup. Please, share your knowledge, if you can. Yes, I've read that since version 8.2 there is an option "INCLUDE LOSG" for "online...
22
2695
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other things. So, in instances where I list, for example, the latest weblogs. I list the headline of the weblog, the date and the name of the member who wrote it. Now, the name isn't just "Smith", but rather Smith's online status, his nick and his...
9
2361
by: =?Utf-8?B?Sm9obiBBdXN0aW4=?= | last post by:
I have an app that prints entry tickets. If the printer driver is not set up exactly to detect the black mark on the back of the ticket, the tickets do not print correctly. Because of this, all users are logging on with the same user name to ensure they get a correctly configured printer driver. The application runs on a Terminal Server via the RDP client. In order to audit the actions of users, it is necessary to identify each user....
10
3629
by: Php Developer | last post by:
I want to know how to check that user is online or offline status if he close his browser with the help of <body onunload>.As it not work well if is user change his page as that time it is too fired.I want only to fire function if user closed browser.
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1596
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.