Live Notification Jquery

前端 未结 2 1798
我寻月下人不归
我寻月下人不归 2021-02-06 17:06

Can someone lead me down the right way to make a live notifications

e.g Knowing when a new Row in Added in Mysql

know if a php file has changed ???

how s

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 17:34

    You can use db triggers to watch for changes in certain tables and insert notification data into a new table. Then. query that db table periodically with Jquery and ajax.

    Workflow:

    1. Create trigger that watched table users for inserts, updates, and deleted
    2. Once users is altered, the trigger inserts a new record into notifications detailing what was changed
    3. Using a periodical updater, check the notifications table for new records and display them to the user.

    This simple workflow might not be as easy to implement as you would hope but it would get the job done in an efficient manner.

提交回复
热议问题