Problem solve Get help with specific problems with your technologies, process and projects.

E-mail notification for database record additions

MySQL expert Mike Hillyer recommends using a combination of a trigger and a user-defined function in order to setup automatic e-mail notification of record additions.

How can I set up my MySQL 4.0 database so that I get e-mail notification each time a record is added? Is there a way to do is using a shell or PHP script?

The simplest way is to add an e-mail send to the application adding the data. In MySQL 5.0, you could use a combination of a trigger and a user-defined function (UDF) to do this, with the UDF calling some form of C function for sending email.

Dig Deeper on Linux servers

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.