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
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 http://www.25thandclement.com/~willi...cts/watch.html
for directory watchers that work on UNIX if you need
instantanious notification btn your databases.