mysql监听器,MySQL表的事件监听器改变了吗?

Is there a php/javascript/mysql/ajax event listener or method that can call a function each time the data in a MySQL table changes - such as when a new row is added, or a row changes/is deleted.

Or am I looking at it from the wrong perspective, I'm still learning AJAX.

Just looking to be pointed in the right direction, I couldn't find anything. Thanks.

Edit

Basically when a user is sitting on my site, if new data is added to the database on the server from another source (not because of an action of this user), I want to be able to call a function to asynchronously load that new data for this user.

解决方案

If you are trying to change date in MySQL based on other changes in MySQL, triggers should work:

If you are looking to have server-side or client-side callbacks when data in MySQL changes, then you won't have that ability via MySQL itself. You would likely need to add something to your schema (flags, timestamps, etc.) that indicate when data is changed and run asynchronous process to do something based on the change in data.

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值