有关数据库更改的实时更新通知MYSQL PHP [英] Live update notification on database changes MYSQL PHP

查看:99
本文介绍了有关数据库更改的实时更新通知MYSQL PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如果使用PHP和MySQL将新记录插入数据库时​​如何触发通知.

I was wondering how to trigger a notification if a new record is inserted into a database, using PHP and MySQL.

推荐答案

最简单的方法可能是每隔几秒钟轮询一次数据库,看看是否插入了新记录.由于数据库中存在查询缓存,因此这不会显着影响数据库性能.

The simplest thing is probably to poll the DB every few seconds and see if new records have been inserted. Due to query caching in the DB this shouldn't effect DB performance substantially.

这篇关于有关数据库更改的实时更新通知MYSQL PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆