Jump to content

Recommended Posts

I've created a trigger and a few tables via mysqli->multi_query() and everything looks alright. However when I invoke the changes that cause the trigger to set I get this result (testing in phpmyadmin):

MySQL said:

#1442 - Can't update table 'd2b_mp_active_threads' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.

 

In my trigger I'm basically moving that whole row into a different table then deleting the row from the original table (d2b_mp_active_threads). Apparently, I'm not allowed to delete the old row though.. how am I able to achieve this?

Link to comment
https://forums.phpfreaks.com/topic/213502-phpmysql-pains/
Share on other sites

basic rule violated  ;)

 

"Within a stored function or trigger, it is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger."

 

for your further reading

http://dev.mysql.com/doc/refman/5.0/en/stored-program-restrictions.html

Link to comment
https://forums.phpfreaks.com/topic/213502-phpmysql-pains/#findComment-1111437
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.