Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Unanswered: monitoring table change

    Hi people,

    i am after a method that is able to check a table in a mysql server to see if any new rows have been added.

    see, i have 2 scripts (php), one on a secure server and one on a public server (both running freebsd)

    when a user makes an update request. the non secure script will place a record in to a table. the secure script then needs to act on this record.

    i want to be able to check if a record has been added so that the secure script will imediately perform its action, not run a cron to perform a select every 5 minutes. other wise there could be a delay


    Blob On

  2. #2
    Join Date
    Nov 2003
    Well, your version of MySQL probably doesn't support
    triggers, so you have to roll your own, so to speak.

    You could make sure every one of your tables has a
    timestamp field, so the secure server could poll every
    minute or so all records with a timestamp that is less
    than 60 seconds old.

    Or, the way I did it, is I write a tiny file to a directory
    every time I add a record to the unsecure DB, and
    a directory watcher program I wrote instantly notices
    every time a
    new file is created in this directory and tells the secure
    server to get to work because it knows that a new record
    was just added. This week I'm on the Wintel platform so
    my directory watcher program is of no use to you (it's
    written in VBasic).
    You may want to check out
    for directory watchers that work on UNIX if you need
    instantanious notification btn your databases.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts