且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何查看用户是否在网站上使用php和mysql驱动的数据库?

更新时间:2022-12-07 07:36:19

您不需要在线/离线标记,只需要保存最后活动时间。当显示用户状态时,如果最后活动时间小于现在+ 15分钟,则用户在线,否则离线。

You don't need the online/offline flag, you just need to save the last activitity time. When displaying the user status, if last activity time is less than now+15 minutes then user is online, offline otherwise.