简体   繁体   中英

How can I receive a notification whenever there are record in a database table?

How do I get a notification whenever there is a record in a particular table in the database?

  1. If I use a Trigger in MySQL will not work when I change database.

  2. If I make an Ajax request every certain interval, I will make unnecessary requests and I've been punished for it in Hostmonster (escape them).

  3. Another idea?

This guy went through the problem as me: http://www.schiffner.com/11-excruciating-months-with-hostmonster-have-come-to-an-end/

Thank you.

Sending Ajax requests at regular intervals (long polling) may not be the best solution but I have seen this implementation in many applications and probably it is easy to implement.

One of the solutions that has not been mentioned here is a PHP script running in a scheduler. This question will help you and make things clearer. Schedule alarm notification system php

Do let me know if you need more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM