I am having a serious trouble using triggers in mysql.
Basically I am trying to update a row on after insert
. I am using the existing value in the row and trying to update an other column of same row.
Ex:
Existing_Name Actual_Name
Product_Arc1 Arc1
Product_Arc2 Arc2
Product_Arc3
I am taking the value of Existing_Name
and extracting the second part of it and updating the Actual_Name
using triggers. BUt since MySQL does not support updating the same table the trigger was activated on? is there any possible way to do what I want?
As of now, I am using PHP script to perform the same effect. But this requires the end user to keep triggering this script from the web browser whenever there are some changes in the database.
Any ideas appreciated.
Thanks.