php mysql 监听器,PHP MYSQL事件侦听器

I need to build a solution for my supervision page.

I have a system for many users and an office manager, and i created a supervision page in order to supervise the login and status of each user.

When the user log-in to the system, ta row in the DB will be updated. same for his status in the system (Busy, Available, offline...).

What i did that i created an iframe in which am checking those data from DB and refreshing the iframe each 5 seconds in order to check any update.

Is there any solution like listener that allow me to get real time data from DB ? Or when the row in the DB changed, so i get this update in my system ?

Thank you all

解决方案

You can do via many methods, some of which are:

take a div instead of your iframe and send AJAX request every 5 seconds and fetch data from database and over write the innerHtml of this div.

cache the data and make it dependent on the database operations like insertion, updation or status change. and show the data in the div from the cache

the best and simplest way is to use pusher.....it works for push notifications and u can notify do anything once the client is notified

I would recommend using pusher.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值