$sql = "DELETE FROM tms_registered where eid ='$sessid' AND uid = '$userid'"; $sql2 = "SELECT COUNT(*) AS max FROM tms_registered WHERE eid ='$sessid'"; $result = mysql_query( $sql2 ) or die ( 'Unable to execute query.' ); $max_value = mysql_result($result, $i, "max"); $sql3 = "UPDATE tms SET cur_reg='$max_value' WHERE tmid='$sessid'";
I have also written the trigger by declaring the variables at the top of the PHP script page and then use 'global': at the begining of the trigger:
global $DB_SERVER, $DB_USER, $DB_PASS, $DB_NAME, $sessid, $userid;
The trigger does not execute after the DELETE transaction. What am I doing wrong?