QUESTION -Checking whether my MySQL datbase has been updated

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

QUESTION -Checking whether my MySQL datbase has been updated

Post by mhouldridge »

Hi,

I would like to create a PHP script that checks my Mysql datbase for any changes, i.e. whether someone has added a record, deleted a record etc ?

thank you,
Mark
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

silly thought, but wouldn't you know when some makes a change to the db via your php scripts already?
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

Ur...

I have hundreds of records and I need to create an auto-send email that informs me of this. I do not know when a new one is created, or deleted.
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

Just realised that I am stupid.

PLEASE IGNORE MY IDIOT QUESTION - its early in the morning and my head is screwed.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

if you want an email every time then you could check out http://www.php.net/function.mail and build a simple emailer to let you know when someone inserts, updates, or deletes something in the db as part of the script that does the inserting, updating or deleting.

What I meant was that your script should check to make sure that any sql query is succesful and if it is then send yourself an email.
Post Reply