I have been trying to use a trigger to update a record after I entered it, the problem is that the following code does not work for me:
CREATE TRIGGER 'test_trigger' AFTER INSERT ON 'chat_test_trigger'
FOR EACH ROW UPDATE chat_test_trigger SET id_chat_enc = md5(id_chat)
What I need is that after you enter a record, grab the autoincrementable that you just assigned and encrypt it in md5 and assign it to a field in that same record.
The problem is that I throw this error when I enter a new row:
# 1442 - Can not update table 'chat_test_trigger' in stored function / trigger because it is used by statement which invoked this stored function / trigger.
Any advice is welcome, thank you.