Forum Moderators: coopster

Message Too Old, No Replies

Mysql PHP help?

mysql triggers works

         

rootlk

8:41 am on Dec 14, 2010 (gmt 0)

10+ Year Member



Can someone post a simple example of how a trigger can be built to send an email on update of a table row?

Matthew1980

11:30 am on Dec 14, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there Rootlk,

Welcome to WebmasterWorld!

An example, in pseudo form:-

<?php

//If the query is successful, and the sql returns true on completion of query
//send a mail

if($update_query){
if(mail(SEND YOUR EMAIL HERE)){
echo "Update complete";
exit;
}
else{
echo "Something went wrong";
exit;
}
}
else{
//something went wrong, show error or redirect to holding/index page
header(REDIRECT HERE);
exit;
}
?>

That will be something like the logic as you need there.

Cheers,
MRb

rootlk

6:32 am on Dec 15, 2010 (gmt 0)

10+ Year Member



thx for the well come,
and
thx for the support